Configuring Agent SDK logging


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 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/ file to one of the locations specified above.
  2. Optional: Modify the file by following the instructions at

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:

Recommendations for learning more: