对于Node.js应用程序,您可以为代理程序日志配置自己的目录。为此,请在node.js应用程序启动文件的第一行中配置日志的目录路径。在logsDir键中传递完整路径。
日志目录路径因平台而异。对于Windows,日志目录格式应在路径分隔符中包含双反斜杠。对于Linux,单个正斜杠将用作路径分隔符。
例:
在Linux中,
require('apminsight')({ licenseKey : 'APMI_ee42094f83dd841d16b9c56796c22b63bef00ac6918f547280947d1f6c2be1ea', appName : 'Insight_NodeJS', port : 3000, apmHost: 'localhost', apmPort: 8443, logsDir: '/Users/learn/logs'
})
在Windows中,
require('apminsight')({ licenseKey : 'APMI_ee42094f83dd841d16b9c56796c22b63bef00ac6918f547280947d1f6c2be1ea', appName : 'Insight_NodeJS', port : 3000, apmHost: 'localhost', apmPort: 8443, logsDir: 'C:\\users\\logs'
})
它允许我们跟踪关键指标,如响应时间、资源利用率、错误率和交易性能。实时监控告警会及时通知我们任何问题或异常,使我们能够立即采取行动。
审稿人角色:研究与开发

Lexmark技术支持经理