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

Disabling file logging #1151

Closed
alexmnv opened this issue Sep 20, 2018 · 3 comments
Closed

Disabling file logging #1151

alexmnv opened this issue Sep 20, 2018 · 3 comments
Labels

Comments

@alexmnv
Copy link

alexmnv commented Sep 20, 2018

Is it possible to disable file logging of a program, but be able to see the output in foreground (supervisorctl fg <program>)? I tried setting stdout_logfile=/dev/null, but the output didn't show in foreground.
That feature would come in handy if, for example, I don't want to keep the logs, but want to see what is going on at the moment.

@cupen
Copy link

cupen commented Mar 4, 2019

Nothing need to do, just keep the default value of stdout_logfile, then supervisorctl tail -f <program> to see what is going on at the moment.

For your another need: " I don't want to keep the logs", you'll find log file in /tmp/ if you keep stdout_logfile default. Usually the /tmp/ path is mounting by tmpfs (https://en.wikipedia.org/wiki/Tmpfs), so…… would you like it?

@alexmnv
Copy link
Author

alexmnv commented Mar 4, 2019

@cupen what you basically suggested is to store log files in /tmp directory. That's not what I asked.
Moreover, /tmp/ is not a default directory for log files in supervisor, and it's a bad piece of advice to store logs on tmpfs as it occupies RAM space.

@mnaberez
Copy link
Member

mnaberez commented Mar 4, 2019

Is it possible to disable file logging of a program, but be able to see the output in foreground (supervisorctl fg )?

No, as internally the fg command uses the same mechanism as the tail command, which reads the log from the disk. You can set stdout_logfile_maxbytes to a low number (say, 1K) and stdout_logfile_backups to 0 to prevent it from using much space. It would take a lot of effort to change how fg works. We are unlikely to change this since a workaround exists, sorry.

@mnaberez mnaberez closed this as completed Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants