nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
15.78k stars 1.4k forks source link

Ability to turn of all logging completely #4581

Open davte-beijer opened 1 year ago

davte-beijer commented 1 year ago

What motivated this proposal?

For edge devices with little flash memory and relatively high life expectancy, writing logs to disk may cause unnecessary wear on the flash memory. As of now there seem to be no place to turn logging off to avoid this and any remote logging is not an option.

What is the proposed change?

Add a flag to the nats server configuration file to disable logging.

Who benefits from this change?

Any application that needs more control over it's logging.

What alternatives have you evaluated?

None

ripienaar commented 1 year ago

It's not as fancy as a dedicated flag, but why not just log to /dev/null?

davte-beijer commented 1 year ago

I should have mentioned that my use case is specifically for windows... /dev/null would not work very well there.

ripienaar commented 1 year ago

You could try logging to NUL on windows for the same effect, not sure its been a while - just mentioning it as at this point a new feature would be months away (beginning of release cycle)

davte-beijer commented 1 year ago

Using NUL on windows seem to be a good workaround, thanks!