Configure custom directory for agent logs in APM Insight Node.js agent

For Node.js applications, you can configure your own directory for your agent logs.

To do so, configure the directory path of your logs in the first line of your node.js application startup file. Pass the complete path in the logsDir key.

The log directory path varies based on the platform.

For Windows, logs directory format should include double backslash in path separator.

For Linux, single forward slash will be used as the path separator.

Example:

In Linux,

require('apminsight')({
licenseKey : 'xxxxxxxxxxxxxxxxxxxx',
appName : 'appName',
port : 3000,
logsDir : '/Users/learn/logs'
})

In Windows,

require('apminsight')({
licenseKey : 'xxxxxxxxxxxxxxxxxxxx',
appName : 'appName',
port : 3000,
logsDir : 'C:\\users\\logs'
})

 

Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.