Logging
This module uses Winston for logging. You can customize the logging or even add your own transports using the APIs below.
#
Log levelsTo set the amount of information that is logged, you can set the logLevel
constructor param to one of the following:
CollabServer.LogLevels.DEBUG
maximum amount of logging. This will log all information including all queries that are executed.CollabServer.LogLevels.INFO
This will log information about server status including server startedCollabServer.LogLevels.WARN
This will log all warnings to the console. Queries will not be logged.CollabServer.LogLevels.ERROR
Only error messages are loggedCollabServer.LogLevels.NONE
Nothing is logged (only uncaught exceptions)
The default log level is INFO
.
Example
#
Filter logs by tagTo filter logs by tag, you can set the filterLogsByTag
option to one or more of the following:
LogTags.ENTITY
- Logged any time a new entity is createdLogTags.MUTATION
- Logged any time a database mutation is performedLogTags.RESPONSE
- Logged any time data is returned from the databaseLogTags.AUTH
- Logs information about user authenticationLogTags.CACHE
- Logs information about cachingLogTags.CONNECTED_USERS
- Logs information about users who are connected to the userLogTags.SCROLL_SYNC
- Logs information about scroll sync sessionsLogTags.ANNOTATION_SYNC
- Logs information about external annotation syncingLogTags.PERMISSIONS
- Logs information about permissions and permission checksLogTags.PERMISSION_CACHE
- Logs information about the permission check cacheLogTags.BATCH
- Logs information about batch writesLogTags.REAL_TIME
- Logs information about real time events that are sentLogTags.UNREAD
- Logs information about the unread status of annotationsLogTags.CLIENT
- (Server only) Logs messages sent from the client to the serverLogTags.ANNOTATIONS
- Logs information about annotation actions (add, edit, delete)
Example
#
TransportsA logging transport is essentially the destination for a log. By default, all logs go to the console, but you can extend this by adding your own transports.
To add your own transports, pass an array of transports to the logTransports
option in the constructor.
Example