Configure logging for Node.js
To prevent crowding stdout, INFO-level statements aren't logged to the console unless the environment variable DEBUG is set to include the Contrast namespace: DEBUG=contrast:*.
The namespace can also be manipulated to show and hide certain paths.
For example, if you want to only see statements within the namespaces contrast:hooks
and contrast:http
, you can set the environment variable as DEBUG=contrast:hooks,contrast:http
. If you want to hide certain namespaces, prepend a -
, as in DEBUG=contrast:*,-contrast:hooks
.
By default, the agent logs to /node-contrast.log. For performance reasons, verbose logging options are disabled. The following configuration options allow you to modify how the agent handles file logging.
Parameter | Description |
---|---|
--agent.logger.append [false] | If |
--agent.logger.level | Logging level: |
--agent.logger.path | Where Contrast will put its debug log. Default is node-contrast.log. |
--agent.logger.stdout [false] | If |