How does `supervisorctl tail` work, for a given process?

我怕爱的太早我们不能终老 提交于 2019-12-09 15:50:20

问题


Where does supervisorctl tail take the log information of a certain process from? How do I get a full log?


回答1:


From the command line help (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

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.

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.

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.



来源:https://stackoverflow.com/questions/11392001/how-does-supervisorctl-tail-work-for-a-given-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!