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
option to one of the following:
LogLevels.DEBUG
maximum amount of logging. This will log all information including all queries that are executed.LogLevels.INFO
This will log information about server status including server startedLogLevels.WARN
This will log all warnings to the console. Queries will not be logged.LogLevels.ERROR
Only error messages are loggedLogLevels.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 of the following:
LogTags.QUERY
: This will log all queries that are executedLogTags.RESPONSE
: This will log all queries' response
You need to set the logLevels
option to LogLevels.DEBUG
to filter logs.
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.
Example