coreybutler / node-windows

Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Other
2.8k stars 356 forks source link

Save logs in a different folder #180

Closed aponce-incomm closed 6 years ago

aponce-incomm commented 7 years ago

Is there any way to set the path for log files that are in daemon/? I would like to save them in a different folder outside the project folder

coreybutler commented 6 years ago

Node-windows provides a feature to write directly to the system event log, but you don't have to use it. You can use any logging module you like to write files anywhere you see fit.

aponce-incomm commented 6 years ago

Thanks @coreybutler. We just did this when creating the service:

var svc = new Service({
 name:'NAME',
 description: 'IDESC',
 logpath: logPathProperty,
 maxRetries: 1,
 maxRestarts: 1,
 script: require('path').join(__dirname,'server.js'),
 stopparentfirst: 'y'
});

You seem to support "logpath", which is ultimately used by winsw, as far as we know. The only problem is that you don't have it documented.

Thanks!