Capability to disable logs
tiberiu89 opened this issue · 3 comments
It would be nice to be able to disable logging output by choice(thinking of an env variable). This could help in production where we send logs to ELK and usually we send them in JSON format, so we don't really want this extra logs there.
In the meantime I found a workaround that might be enough, so it's up to you if you want to close the issue
Basically I ended up changing the command of the container and send the logs to /dev/null only for this command
CMD /wait > /dev/null 2>&1 && ...
UPDATE:
I haven't tested it yet, but indeed at least errors should go to stderr so maybe a variation on the above, until we have configurable log level
CMD /wait > /dev/null && ...
I think this should redirect only stdout, will work if errors are written to stderr
@tiberiu89
This would be pretty simple to implement; anyway, I would never use a tool that can prevent my application to start without any feedback.
I will double think about this, maybe introducing a configurable logger level would be a better approach.
In version 2.8.0, you can now disable the logs with the WAIT_LOGGER_LEVEL
environment variable. E.g.:
mySuperApp:
image: "mySuperApp:latest"
hostname: mySuperApp
environment:
WAIT_LOGGER_LEVEL: off