在docker容器中查找gunicorn日志文件

Dre*_*ams 13 python-3.x gunicorn docker

我有一个使用 Gunicorn 运行 python 服务的 docker 容器。这就是服务的启动方式:

\n\n

gunicorn --bind 0.0.0.0:6435 --certfile=cert.pem --keyfile=key.pem --ssl-version=5 --ciphers=EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH app:app -w=5 --timeout=500 --daemon

\n\n

但是,我无法找到 5 名工人的日志文件。查找这些日志文件的默认路径是什么?

\n\n

我尝试使用 find 命令,find / -type f -name "hs_err_pid"因为这些是gunicorn 保存日志文件的默认文件名。但这给了我以下权限错误:

\n\n
    find: \xe2\x80\x98/proc/1/map_files\xe2\x80\x99: Operation not permitted\nfind: \xe2\x80\x98/proc/16/map_files\xe2\x80\x99: Operation not permitted\nfind: \xe2\x80\x98/proc/89/map_files\xe2\x80\x99: Operation not permitted\n
Run Code Online (Sandbox Code Playgroud)\n\n

有什么办法可以找到日志文件吗?

\n

Lin*_*nPy 10

我建议您添加--access-logfile YOUR_FILE到命令中以指定文件或使用 .redirect 将其重定向到 stdout -。错误日志也是如此。

看到这个