当前位置: 首页 > 知识库问答 >
问题:

启用WARN loglevel时,Supervisor不会从应用程序收集日志

段干博涉
2023-03-14

我有LEMP复合docker容器,由docker-compose编译。

[supervisord]
nodaemon=true
loglevel=debug
loglevel=warn

(或信息、错误、警报等)我的stdout流中根本没有日志!
我只需要传递到活动日志消息,具有警告级别或更高级别。supervisord如何“理解”,它从应用程序接收到的日志消息的级别?
它可能对日志消息格式有任何规范吗?还是设置不够?

主管配置

[program:php-fpm]
command=php-fpm -F
autostart=true
autorestart=true
priority=5
stdout_events_enabled=true
stderr_events_enabled=true
redirect_stderr=true

[program:nginx]
command=nginx -g 'daemon off;'
autostart=true
autorestart=true
priority=10
stdout_events_enabled=true
stderr_events_enabled=true
redirect_stderr=true

[supervisord]
nodaemon=true
loglevel=debug

共有1个答案

孙星鹏
2023-03-14

您需要告诉supervisor将容器的stdout写到它自己的Supervisord日志中,使用:

stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0

因此您的配置是:

[program:php-fpm]
command=php-fpm -F
autostart=true
autorestart=true
priority=5
stdout_events_enabled=true
stderr_events_enabled=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true

[program:nginx]
command=nginx -g 'daemon off;'
autostart=true
autorestart=true
priority=10
stdout_events_enabled=true
stderr_events_enabled=true
redirect_stderr=true

[supervisord]
nodaemon=true
loglevel=debug
 类似资料:
  • 下面是上面文件引用的: 但当以的身份运行InteliJ时,问题就会消失。

  • 前言 在进行日志收集的过程中,我们首先想到的是使用Logstash,因为它是ELK stack中的重要成员,但是在测试过程中发现,Logstash是基于JDK的,在没有产生日志的情况单纯启动Logstash就大概要消耗500M内存,在每个Pod中都启动一个日志收集组件的情况下,使用logstash有点浪费系统资源,经人推荐我们选择使用Filebeat替代,经测试单独启动Filebeat容器大约会消

  • 问题是,当我在Google中使用授权运行此代码时,它会立即崩溃: 但是日志中的错误: 2019-06-22 17:55:42.652 29327-23222/?E/AudioSource:在已关闭的AudioSource 2019-06-22 17:55:43.240 2093-2616/?E/TouchFilter:setTouchFilter日志启用参数:0 2019-06-22 17:55:

  • 我在intellij上启动spring boot应用程序时遇到问题,它失败了,并显示以下消息:与目标VM断开连接,地址:'127.0.0.1:49784',传输:'socket' 过程结束,退出代码为255。以前有人遇到过这种情况吗?

  • 我正在docker容器中运行一个简单的spring boot应用程序。在启动时,是否从或应用程序将始终在以下时间点挂起: 这里有一个问题,我只能在数字海洋(1CPU,1GB MEM)的Ubuntu 14.04盒子上重现这个,即使它在容器中运行。在我的本地机器上,一切都运行良好。 Dockerfile文件: 我尝试过的事情 给JVM更多内存(占机器总数的75%) 按这里建议的方式停止库 我能接触到的

  • 手机是OnePlus3T。oxygen OS版本为4.1.6。当应用程序在前台、后台但在内存中时,应用程序会收到通知。但当应用程序不在内存中(即从内存中刷出)时不会收到通知。其他安装了android操作系统版本4.2、5.1.1、6.0.1、7.1.1的设备也会收到通知,即使应用程序不在内存中。 好心建议点什么。提前道谢。