Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] err.log and out.log has size limited? #322

Closed
radiorz opened this issue Sep 22, 2022 · 1 comment
Closed

[question] err.log and out.log has size limited? #322

radiorz opened this issue Sep 22, 2022 · 1 comment

Comments

@radiorz
Copy link

radiorz commented Sep 22, 2022

Issue:

How To Reproduce:

start node-windows server
in daemon the err.log and out.log will save the logs of service.
but it seems that it could not contain too much logs.

Expected Behavior:

I can choose the size of logs

Desktop:

  • OS: windows
@radiorz radiorz changed the title err.log and out.log has size limited? [question] err.log and out.log has size limited? Sep 22, 2022
@coreybutler
Copy link
Owner

node-windows has no constraints on the log size, but winsw does. This can be overridden using the logging configiuration attribute in the server.

For example:

var svc = new Service({
  name:'Hello World',
  description: 'The nodejs.org example web server.',
  script: 'C:\\path\\to\\helloworld.js',
  logging: {
    mode: 'roll-by-size', 
    sizeThreshold: 10240,    // <--- change this
    keepFiles: 8
  },
  nodeOptions: [
    '--harmony',
    '--max_old_space_size=4096'
  ]
  //, workingDirectory: '...'
  //, allowServiceLogon: true
});

The logging configuration options are passed straight to the winsw XML configuration. You can see more options in the function comments at https://github.com/coreybutler/node-windows/blob/master/lib/winsw.js#L20-L23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants