在给定的过程中,"supervisorctl tail"如何工作? [英] How does `supervisorctl tail` work, for a given process?
问题描述
supervisorctl tail
从哪里获取某个进程的日志信息?如何获取完整的日志?
Where does supervisorctl tail
take the log information of a certain process from? How do I get a full log?
推荐答案
从命令行帮助(supervisorctl help tail
):
tail [-f] <name> [stdout|stderr] (default stdout)
Ex:
tail -f <name> Continuous tail of named process stdout
Ctrl-C to exit.
tail -100 <name> last 100 *bytes* of process stdout
tail <name> stderr last 1600 *bytes* of process stderr
因此,默认情况下,tail
命令将尾部输出到标准输出.如果需要获取完整的日志,请使用[program:x]
的 stdout_logfile
选项部分确定该文件的存储位置;还有一个stderr_logfile
选项.
So by default, the tail
command tails the process stdout. If you need to get the full log, the stdout_logfile
option of the [program:x]
section determines where that is stored; there is a stderr_logfile
option as well.
如果未设置该选项或未将其设置为AUTO
,则在进程启动时将创建一个日志文件,但是在主管重启时会清除该日志文件.该文件是在 [supervisord]
childlogdir
选项设置的目录中创建的(默认情况下是平台的 TMP
目录),并具有生成的文件名,格式为<program-name>-<stdout|stderr>---<supervisor-identifier>-<6-random-characters>.log
,例如varnish-stdout---supervisor-AqY52e.log
.
If that option is not set or set to AUTO
, a logfile will be created when the process starts, but cleaned up whenever supervisord restarts. This file is created in the directory set by the [supervisord]
childlogdir
option (which is your platform's TMP
directory by default), and have a generated filename of the form <program-name>-<stdout|stderr>---<supervisor-identifier>-<6-random-characters>.log
, e.g. varnish-stdout---supervisor-AqY52e.log
.
因此,如果要访问整个标准输出日志,则至少需要将childlogdir
选项设置为固定目录,以免您不得不搜索正确的临时目录.
Thus, if you want to access the whole stdout log, you need to at the very least set the childlogdir
option to a fixed directory to save you from having to search for the right temporary directory.
这篇关于在给定的过程中,"supervisorctl tail"如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!