I am using bunyan for logging on my node.js API which is hosted in aws. When I load test the API, it falls over after 4000 file descriptors. We found that the open file descriptors on the app increase with each request. The code to configure the bunyan logger is given below
var defaultLogFileName = "/var/log/test_api.log",
defaultLogLevel = "debug";
var logger = bunyan.createLogger({
name: 'resumes',
streams: [{
path: process.env.LogFileName || defaultLogFileName,
level: process.env.LogLevel || defaultLogLevel
}]
});
app.on('after', function(req) {
logger.info("response = ", res);
}
We are running this API in a docker container hosted on ECS and using restify. Has the bunyan logger been implemented correctly? Is there anything that I have missed?