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

Add prefix to supervisord program stdout logs #1326

Closed
sffc opened this issue Feb 8, 2020 · 1 comment
Closed

Add prefix to supervisord program stdout logs #1326

sffc opened this issue Feb 8, 2020 · 1 comment
Labels

Comments

@sffc
Copy link

sffc commented Feb 8, 2020

I'm using supervisord in Docker and have my application logs configured like so:

redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0

In the stdout of supervisord, though, the messages get displayed directly from the subprocesses, and it is not always possible to tell which subprocess is responsible for which log message. For example, I see something like this:

2020-02-08 20:49:27,572 INFO supervisord started with pid 1
2020-02-08 20:49:28,583 INFO spawned: 'nginx' with pid 8
2020-02-08 20:49:28,585 INFO spawned: 'php-fpm' with pid 9
[08-Feb-2020 20:49:28] NOTICE: fpm is running, pid 9
[08-Feb-2020 20:49:28] NOTICE: ready to handle connections
[08-Feb-2020 20:49:28] NOTICE: systemd monitor interval set to 10000ms

The first 3 messages are from supervisord itself, and the last 3 are from php-fpm. I would rather see something like this:

2020-02-08 20:49:27,572 INFO supervisord started with pid 1
2020-02-08 20:49:28,583 INFO spawned: 'nginx' with pid 8
2020-02-08 20:49:28,585 INFO spawned: 'php-fpm' with pid 9
2020-02-08 20:49:28,600 INFO program php-fpm: NOTICE: fpm is running, pid 9
2020-02-08 20:49:28,601 INFO program php-fpm: NOTICE: ready to handle connections
2020-02-08 20:49:28,602 INFO program php-fpm: NOTICE: systemd monitor interval set to 10000ms

Then, if I'm interested only in the logs from php-fpm, I can easily grep for them.

@mnaberez
Copy link
Member

mnaberez commented Feb 8, 2020

Duplicate of #553

@mnaberez mnaberez marked this as a duplicate of #553 Feb 8, 2020
@mnaberez mnaberez closed this as completed Feb 8, 2020
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

2 participants