Skip to content

Commit 0dec358

Browse files
committed
Update README.md
1 parent b56ea1e commit 0dec358

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,36 @@ Logs are also viewable in Parse Dashboard.
754754
755755
**Want new line delimited JSON error logs (for consumption by CloudWatch, Google Cloud Logging, etc)?** Pass the `JSON_LOGS` environment variable when starting `parse-server`. Usage :- `JSON_LOGS='1' parse-server --appId APPLICATION_ID --masterKey MASTER_KEY`
756756
757+
### MongoDB Client Event Logging
758+
759+
Monitor MongoDB driver behavior by logging specific client events. This is useful for debugging connection issues, tracking topology changes, and monitoring connection pool health.
760+
761+
```js
762+
const server = new ParseServer({
763+
databaseOptions: {
764+
logClientEvents: [
765+
{
766+
name: 'serverDescriptionChanged',
767+
keys: ['address', 'previousDescription.type', 'newDescription.type'],
768+
logLevel: 'warn'
769+
},
770+
{
771+
name: 'connectionPoolCleared',
772+
keys: ['address', 'serviceId'],
773+
logLevel: 'error'
774+
}
775+
]
776+
}
777+
});
778+
```
779+
780+
Each event configuration requires:
781+
- `name` - The MongoDB driver event (e.g., `topologyDescriptionChanged`, `connectionPoolReady`)
782+
- `keys` - (Optional) Dot-notation paths to extract specific data; omit to log the entire event
783+
- `logLevel` - Log level: `error`, `warn`, `info`, or `debug`
784+
785+
See [MongoDB driver events documentation](https://www.mongodb.com/docs/drivers/node/current/fundamentals/monitoring/) for available events.
786+
757787
# Deprecations
758788
759789
See the [Deprecation Plan](https://github.com/parse-community/parse-server/blob/master/DEPRECATIONS.md) for an overview of deprecations and planned breaking changes.

0 commit comments

Comments
 (0)