It doesn't make a sense when workers are all equal and do the same job, but it does make sense, when each worker may work on different jobs. For example, when I need to route incoming http requests to a special Node instance based by some rule, I may also need to separate logs, generated by workers (btw: that is why I need "standalone.js" use-case to work without exceptions - see my prev. bugrep #89).
It's easy to extend current logger.js plugin to make this thing work, but I think, that feature should be "in the core":
add third parameter to the logger plugin declaration:
yeah i used to have them in separate files actually but like you said it doesnt make tons of sense for something that is behaving as one. Options are always good though :)
It doesn't make a sense when workers are all equal and do the same job, but it does make sense, when each worker may work on different jobs. For example, when I need to route incoming http requests to a special Node instance based by some rule, I may also need to separate logs, generated by workers (btw: that is why I need "standalone.js" use-case to work without exceptions - see my prev. bugrep #89).
It's easy to extend current logger.js plugin to make this thing work, but I think, that feature should be "in the core":
add third parameter to the logger plugin declaration:
logger.js:47 module.exports = function(dir, level, bOwnLog){
and change lines 139/140 to:
var access = fs.createWriteStream(dir + '/workers.access'+(bOwnLog? '.'+worker.id : '')+'.log', { flags: 'a' }) , error = fs.createWriteStream(dir + '/workers.error'+(bOwnLog? '.'+worker.id : '')+'.log', { flags: 'a' });
This changes shouldn't break anything, but give more value to users.
Thank you.