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

Any way to produce less log? #126

Open
tanus10 opened this issue Jan 28, 2018 · 7 comments
Open

Any way to produce less log? #126

tanus10 opened this issue Jan 28, 2018 · 7 comments

Comments

@tanus10
Copy link

tanus10 commented Jan 28, 2018

Since these are, in many case, running on a SD card + Raspberry pi, once everything works, it is desirable to have less or even no log at all to preserve SD card life.

Is there any way or a future plan to reduce amount of log it produces?

@stjohnjohnson
Copy link
Owner

Hmm. Good question. It's all in winston. It should be possible to tweak that. I typically just have it all on logrotate.d. You could cheat and make the files a symlink to /dev/null.

@stjohnjohnson
Copy link
Owner

https://www.npmjs.com/package/winston#using-logging-levels would be how to set the log level per transport.

@tanus10
Copy link
Author

tanus10 commented Jan 29, 2018

I was actually thinking about some configurable options in config.ylm, but I guess symlink would do the job.

@stjohnjohnson
Copy link
Owner

Oh yeah, totally. It's best done via a setting in the yml, but until I or someone gives a PR for it, you can cheat by symlinking :)

@airdrummingfool
Copy link
Contributor

@tanus10 I'm looking into making a PR for this. Would the ability to set the log level for the file transport ( which writes events.log, access.log, and error.log) be enough? You could set it to error, which would prevent all of the normal log messages from being written to disk (errors would still get written, but that seems like a good thing to me).

@nphil
Copy link

nphil commented Oct 24, 2018

@airdrummingfool any progress on this PR? My log files are getting pretty huge and the constant writing to disk is quite annoying and unnecessary.

@airdrummingfool
Copy link
Contributor

@nphil thanks for the nudge... I'd completely forgotten about this. I managed to find the code I was working with in my git stash - I tested it and it seems to work, but take a look and let me know if this is useful. It's not necessarily PR quality yet but I've thrown it up anyways for discussion (see #173).

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

4 participants