APM Insight Node.js Agent custom logs directory


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 : 'APMI_ee42094f83dd841d16b9c56796c22b63bef00ac6918f547280947d1f6c2be1ea',
    appName : 'Insight_NodeJS',
    port : 3000,
    apmHost: 'localhost',
    apmPort: 8443,
    logsDir: '/Users/learn/logs'
})

In Windows,

require('apminsight')({
    licenseKey : 'APMI_ee42094f83dd841d16b9c56796c22b63bef00ac6918f547280947d1f6c2be1ea',
    appName : 'Insight_NodeJS',
    port : 3000,
    apmHost: 'localhost',
    apmPort: 8443,
    logsDir: 'C:\\users\\logs'
})

Thank you for your feedback!

Was this content helpful?

We are sorry. Help us improve this page.

How can we improve this page?
Do you need assistance with this topic?
By clicking "Submit", you agree to processing of personal data according to the Privacy Policy.