Configuring Agent SDK logging

BETA

The New Relic Agent SDK uses log4cplus for logging. This provides flexibility into log levels, log file locations, etc.

Customizing your log4cplus files

The SDK searches for a log4cplus.properties file in this order:

  1. The location specified by NEWRELIC_LOG_PROPERTIES_FILE environment variable
  2. Your $HOME/.newrelic directory
  3. The current working directory

To configure logging:

  1. Copy the config/log4cplus.properties file to one of the locations specified above.
  2. Optional: Modify the log4cplus.properties file by following the instructions at http://sourceforge.net/p/log4cplus/wiki/Home/.

Reviewing log files

All functions in the SDK return integers or longs. Any positive number indicates success and any negative number indicates a failure. For a list of all error codes, see the New Relic header files for a list of all error codes.

For more help

Additional documentation resources include:

Troubleshoot and ask questions about the Agent SDK in New Relic's Online Technical Community!

If you need additional help, get support at support.newrelic.com.