On this page:

Related pages:

Your Rating:
Results:
PatheticBadOKGoodOutstanding!
17 rates

By default, the Node.js Agent generates log information at the informational level. You can increase or 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.log

Where <hash> is the portion of the path as used for the Java proxy. 

On Windows, you can find the tmp directory with:
cd %tmp%
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. 

The following sample shows the logging settings when you are in libagent 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 following sample shows the logging settings when you are in 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.
  }
 
...
}

As illustrated, you can change the level, maximum size or number of files, and mode.

The level determines the verbosity of logging output. It can have one these values, as 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 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 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/logs.

See Dynamic Agent Proxy Logging

Debug Logging

Instead of using the logging configuration shown above, you can use the shortcut of setting DEBUG to true, as follows: 

debug : true,

This results in debug level logging, with the location of the debug log file written to standard output.

See Node.js Agent Settings

  • No labels