Skip to content

Flask print output not showing in log file when managed by Supervisor #1676

@Dovelet1

Description

@Dovelet1

Hello everyone!
Environment:
Docker
Supervisor managing multiple Flask services

Description: I’m running multiple Flask services inside a Docker container and using Supervisor to manage them. I have configured Supervisor to capture the standard output (stdout) and error output (stderr) by specifying log file paths in the Supervisor configuration, like this:

[program:flaskapp]
command=python /path/to/your/app.py
directory=/path/to/your/app
autostart=true
autorestart=true
stderr_logfile=/var/log/flaskapp.err.log
stdout_logfile=/var/log/flaskapp.out.log

However, I’ve noticed that the print statements within the Flask application are not showing up in the log file /var/log/flaskapp.out.log. I expected the content from print to be captured in the log file, but it doesn't appear there.

Is there any additional configuration required to ensure that print statements show up in the log files?

Any help or insights would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions