This page explains Node.js Agent logging for the Java proxy mode.

By default, the Node.js Agent generates log information at the informational level. You can increase/decrease the logging verbosity, change the log file location, and configure other logging settings. 

Node.js Agent Logging Location

The log file appears at the following location on the machine where the Node.js Agent runs: 

/tmp/appd/<hash>/appd_node_agent_<datetime>.log
CODE

If you are running the Node.js Agent, <hash> is generated by the agent.

On Windows, you can find the tmp directory with cd %tmp% d and then look for the <hash> directory.

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 when you are in the Java proxy mode:

{
...
 
  logging: {
     '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.
  }
 
...
}
CODE

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. 

Proxy Logging

The Java proxy logs the transactions that are accepted from the agent and sent to the Controller. The proxy generates logs independently of the Node.js Agent's logging level or activity.

When the Node.js Agent launches the proxy, it prints the directory path at which the proxy is logging to its own log. By default, the proxy log is in /tmp/appd/<hash>/proxy/logs.

See Dynamic Agent Proxy Logging.

Debug Logging

Instead of the logging configuration above, you can use this shortcut to set DEBUG to true, resulting in debug level logging.

debug : true,
CODE

The location of the debug log file is written in standard output.

See Node.js Agent Settings.