Configure Node.js Agent Logging
To configure logging, use the logging module configuration in the Node.js require statement. You can change the level, maximum size/number of files, and mode.
The following sample shows the logging settings in default mode:
{
...
logging: {
'logfiles': [
{
'root_directory': '/tmp/appd',
'filename': 'echo_%N.log',
'level': 'TRACE',
'max_size': 5242880,
'max_files': 10,
'outputType': 'console' // Set this parameter if you want to log to STDOUT/STDERR. Omit this parameter if you want to log to a file.
}
]
}
...
}
The level determines the verbosity of logging output and can contain one of the following values listed from least to most verbose:
-
FATAL
-
ERROR
-
WARN
-
INFO
-
DEBUG
-
TRACE
By default, once the size of the logging files on disk reaches the maximum size, old logs are purged. You can reduce or increase the size, depending on your needs and the disk space available on the machine.