我使用这个工具导师 https://github.com/Supervisor/supervisor在 docker 容器中构建某个应用程序。使用主管控制的进程以 JSON 格式输出日志。但主管以文本格式输出日志。
有没有办法让主管也以 JSON 格式输出日志?
有例子:
2024-02-05 08:34:22,987 INFO Set uid to user 0 succeeded
2024-02-05 08:34:22,992 INFO supervisord started with pid 19
2024-02-05 08:34:24,014 INFO spawned: 'cloudftp' with pid 20
2024-02-05 08:34:24,021 INFO spawned: 'cloudftps' with pid 21
{"context":{"process":20,"user":""},"channel":"default","datetime":"2024-02-05T08:34:24.000+0000","level_name":"CRITICAL","message":"Warning. \"tmpfolder\" in config file is /scratch/cloudftp But, such folder not exists! So, will be used /var/www/smestorage/ftpserver/tmp/"}
Undefined address for Socket::pack_sockaddr_in at /usr/lib/x86_64-linux-gnu/perl-base/Socket.pm line 172.
2024-02-05 08:34:24,628 INFO exited: cloudftp (exit status 255; not expected)
{"message":"Warning. \"tmpfolder\" in config file is /scratch/cloudftp But, such folder not exists! So, will be used /var/www/smestorage/ftpserver/tmp/","context":{"process":21,"user":""},"channel":"default","datetime":"2024-02-05T08:34:24.000+0000","level_name":"CRITICAL"}
2024-02-05 08:34:24,665 INFO gave up: cloudftp entered FATAL state, too many start retries too quickly
{"datetime":"2024-02-05T08:34:24.000+0000","channel":"ftpis","level_name":"CRITICAL","context":{"process":21,"user":""},"message":"FTPS server (implicit FTP over TLS) disabled by option disable_ftps!"}
2024-02-05 08:34:24,671 INFO exited: cloudftps (exit status 12; not expected)
2024-02-05 08:34:25,673 INFO gave up: cloudftps entered FATAL state, too many start retries too quickly
我需要将 Docker 容器的所有日志都设为 JSON。我该如何使用主管日志配置来实现这一点?