2014-04-28 4 views
5

मैंने पर्यवेक्षक के साथ कुछ php प्रक्रियाएं शुरू की हैं, और मैं एक फ़ाइल पर सभी stdout लॉग और दूसरे पर त्रुटि आउटपुट रख रहा हूं। मैंने अधिकतम आकार 1 एमबी पर सेट किया है और मैं प्रत्येक प्रक्रिया की 3 प्रतियां चला रहा हूं। जब मैं लॉग की जांच करता हूं तो लॉग फ़ाइलों में से एक से अधिक प्रतीत होता है, इसलिए "log1.log" के बजाय "log1.log log1.log.1 log1.log.2 log1.log.3" है। प्रक्रिया सही ढंग से काम करने लगती है इसलिए मैं सिर्फ स्पष्टीकरण मांग रहा हूं, ऐसा इसलिए होता है क्योंकि लॉग को दूसरी प्रक्रिया द्वारा लिखने के लिए बंद कर दिया जाता है, इसलिए प्रक्रिया को लिखने की कोशिश करने वाली प्रक्रिया को दूसरी फ़ाइल का उपयोग करना पड़ता है?पर्यवेक्षक लॉग फ़ाइल रोटेशन सेटिंग्स

[program:Sitbot1_1_1] 
command=/usr/local/bin/php -f process.php 1 1 1 2   ; the program (relative uses PATH, can take args) 
process_name=%(program_name)s_%(process_num)02d ; process_name expr (default %(program_name)s) 
numprocs=3     ; number of processes copies to start (def 1) 
directory=/home/userkdo/domains/domain/public_html/bot1    ; directory to cwd to before exec (def no cwd) 
;umask=022      ; umask for process (default None) 
;priority=999     ; the relative start priority (default 999) 
autostart=false    ; start at supervisord start (default: true) 
autorestart=true  ; whether/when to restart (default: unexpected) 
;startsecs=1     ; number of secs prog must stay running (def. 1) 
;startretries=3    ; max # of serial start failures (default 3) 
;exitcodes=0,2     ; 'expected' exit codes for process (default 0,2) 
;stopsignal=TERM    ; signal used to kill process (default TERM) 
;stopwaitsecs=10    ; max num secs to wait b4 SIGKILL (default 10) 
;stopasgroup=true    ; send stop signal to the UNIX process group (default false) 
;killasgroup=true    ; SIGKILL the UNIX process group (def false) 
user=userkdo     ; setuid to this UNIX account to run the program 
;redirect_stderr=true   ; redirect proc stderr to stdout (default false) 
stdout_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.log  ; stdout log path, NONE for none; default AUTO 
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stdout_logfile_backups=10  ; # of stdout logfile backups (default 10) 
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stdout_events_enabled=false ; emit events on stdout writes (default false) 
stderr_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.err  ; stderr log path, NONE for none; default AUTO 
stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stderr_logfile_backups=10  ; # of stderr logfile backups (default 10) 
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stderr_events_enabled=false ; emit events on stderr writes (default false) 
;environment=A="1",B="2"  ; process environment additions (def no adds) 
;serverurl=AUTO    ; override serverurl computation (childutils) 





[program:Sitbot1_1_2] 
command=/usr/local/bin/php -f process.php 1 2 3 4   ; the program (relative uses PATH, can take args) 
process_name=%(program_name)s_%(process_num)02d ; process_name expr (default %(program_name)s) 
numprocs=3     ; number of processes copies to start (def 1) 
directory=/home/userkdo/domains/domain/public_html/bot1    ; directory to cwd to before exec (def no cwd) 
;umask=022      ; umask for process (default None) 
;priority=999     ; the relative start priority (default 999) 
autostart=false    ; start at supervisord start (default: true) 
autorestart=true  ; whether/when to restart (default: unexpected) 
;startsecs=1     ; number of secs prog must stay running (def. 1) 
;startretries=3    ; max # of serial start failures (default 3) 
;exitcodes=0,2     ; 'expected' exit codes for process (default 0,2) 
;stopsignal=TERM    ; signal used to kill process (default TERM) 
;stopwaitsecs=10    ; max num secs to wait b4 SIGKILL (default 10) 
;stopasgroup=true    ; send stop signal to the UNIX process group (default false) 
;killasgroup=true    ; SIGKILL the UNIX process group (def false) 
user=userkdo     ; setuid to this UNIX account to run the program 
;redirect_stderr=true   ; redirect proc stderr to stdout (default false) 
stdout_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.log  ; stdout log path, NONE for none; default AUTO 
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stdout_logfile_backups=10  ; # of stdout logfile backups (default 10) 
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stdout_events_enabled=false ; emit events on stdout writes (default false) 
stderr_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.err  ; stderr log path, NONE for none; default AUTO 
stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stderr_logfile_backups=10  ; # of stderr logfile backups (default 10) 
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stderr_events_enabled=false ; emit events on stderr writes (default false) 
;environment=A="1",B="2"  ; process environment additions (def no adds) 
;serverurl=AUTO    ; override serverurl computation (childutils) 





[program:Sitbot1_1_3] 
command=/usr/local/bin/php -f process.php 1 3 5 6   ; the program (relative uses PATH, can take args) 
process_name=%(program_name)s_%(process_num)02d ; process_name expr (default %(program_name)s) 
numprocs=3     ; number of processes copies to start (def 1) 
directory=/home/userkdo/domains/domain/public_html/bot1    ; directory to cwd to before exec (def no cwd) 
;umask=022      ; umask for process (default None) 
;priority=999     ; the relative start priority (default 999) 
autostart=false    ; start at supervisord start (default: true) 
autorestart=true  ; whether/when to restart (default: unexpected) 
;startsecs=1     ; number of secs prog must stay running (def. 1) 
;startretries=3    ; max # of serial start failures (default 3) 
;exitcodes=0,2     ; 'expected' exit codes for process (default 0,2) 
;stopsignal=TERM    ; signal used to kill process (default TERM) 
;stopwaitsecs=10    ; max num secs to wait b4 SIGKILL (default 10) 
;stopasgroup=true    ; send stop signal to the UNIX process group (default false) 
;killasgroup=true    ; SIGKILL the UNIX process group (def false) 
user=userkdo     ; setuid to this UNIX account to run the program 
;redirect_stderr=true   ; redirect proc stderr to stdout (default false) 
stdout_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.log  ; stdout log path, NONE for none; default AUTO 
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stdout_logfile_backups=10  ; # of stdout logfile backups (default 10) 
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stdout_events_enabled=false ; emit events on stdout writes (default false) 
stderr_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.err  ; stderr log path, NONE for none; default AUTO 
stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stderr_logfile_backups=10  ; # of stderr logfile backups (default 10) 
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stderr_events_enabled=false ; emit events on stderr writes (default false) 
;environment=A="1",B="2"  ; process environment additions (def no adds) 
;serverurl=AUTO    ; override serverurl computation (childutils) 





[program:Sitbot1_1_4] 
command=/usr/local/bin/php -f process.php 1 4 7 9   ; the program (relative uses PATH, can take args) 
process_name=%(program_name)s_%(process_num)02d ; process_name expr (default %(program_name)s) 
numprocs=3     ; number of processes copies to start (def 1) 
directory=/home/userkdo/domains/domain/public_html/bot1    ; directory to cwd to before exec (def no cwd) 
;umask=022      ; umask for process (default None) 
;priority=999     ; the relative start priority (default 999) 
autostart=false    ; start at supervisord start (default: true) 
autorestart=true  ; whether/when to restart (default: unexpected) 
;startsecs=1     ; number of secs prog must stay running (def. 1) 
;startretries=3    ; max # of serial start failures (default 3) 
;exitcodes=0,2     ; 'expected' exit codes for process (default 0,2) 
;stopsignal=TERM    ; signal used to kill process (default TERM) 
;stopwaitsecs=10    ; max num secs to wait b4 SIGKILL (default 10) 
;stopasgroup=true    ; send stop signal to the UNIX process group (default false) 
;killasgroup=true    ; SIGKILL the UNIX process group (def false) 
user=userkdo     ; setuid to this UNIX account to run the program 
;redirect_stderr=true   ; redirect proc stderr to stdout (default false) 
stdout_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.log  ; stdout log path, NONE for none; default AUTO 
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stdout_logfile_backups=10  ; # of stdout logfile backups (default 10) 
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stdout_events_enabled=false ; emit events on stdout writes (default false) 
stderr_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.err  ; stderr log path, NONE for none; default AUTO 
stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stderr_logfile_backups=10  ; # of stderr logfile backups (default 10) 
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stderr_events_enabled=false ; emit events on stderr writes (default false) 
;environment=A="1",B="2"  ; process environment additions (def no adds) 
;serverurl=AUTO    ; override serverurl computation (childutils) 





[program:Sitbot1_1_5] 
command=/usr/local/bin/php -f process.php 1 5 10 12   ; the program (relative uses PATH, can take args) 
process_name=%(program_name)s_%(process_num)02d ; process_name expr (default %(program_name)s) 
numprocs=3     ; number of processes copies to start (def 1) 
directory=/home/userkdo/domains/domain/public_html/bot1    ; directory to cwd to before exec (def no cwd) 
;umask=022      ; umask for process (default None) 
;priority=999     ; the relative start priority (default 999) 
autostart=false    ; start at supervisord start (default: true) 
autorestart=true  ; whether/when to restart (default: unexpected) 
;startsecs=1     ; number of secs prog must stay running (def. 1) 
;startretries=3    ; max # of serial start failures (default 3) 
;exitcodes=0,2     ; 'expected' exit codes for process (default 0,2) 
;stopsignal=TERM    ; signal used to kill process (default TERM) 
;stopwaitsecs=10    ; max num secs to wait b4 SIGKILL (default 10) 
;stopasgroup=true    ; send stop signal to the UNIX process group (default false) 
;killasgroup=true    ; SIGKILL the UNIX process group (def false) 
user=userkdo     ; setuid to this UNIX account to run the program 
;redirect_stderr=true   ; redirect proc stderr to stdout (default false) 
stdout_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.log  ; stdout log path, NONE for none; default AUTO 
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stdout_logfile_backups=10  ; # of stdout logfile backups (default 10) 
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stdout_events_enabled=false ; emit events on stdout writes (default false) 
stderr_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.err  ; stderr log path, NONE for none; default AUTO 
stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stderr_logfile_backups=10  ; # of stderr logfile backups (default 10) 
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stderr_events_enabled=false ; emit events on stderr writes (default false) 
;environment=A="1",B="2"  ; process environment additions (def no adds) 
;serverurl=AUTO    ; override serverurl computation (childutils) 





[program:Sitbot1_1_6] 
command=/usr/local/bin/php -f process.php 1 6 13 15   ; the program (relative uses PATH, can take args) 
process_name=%(program_name)s_%(process_num)02d ; process_name expr (default %(program_name)s) 
numprocs=3     ; number of processes copies to start (def 1) 
directory=/home/userkdo/domains/domain/public_html/bot1    ; directory to cwd to before exec (def no cwd) 
;umask=022      ; umask for process (default None) 
;priority=999     ; the relative start priority (default 999) 
autostart=false    ; start at supervisord start (default: true) 
autorestart=true  ; whether/when to restart (default: unexpected) 
;startsecs=1     ; number of secs prog must stay running (def. 1) 
;startretries=3    ; max # of serial start failures (default 3) 
;exitcodes=0,2     ; 'expected' exit codes for process (default 0,2) 
;stopsignal=TERM    ; signal used to kill process (default TERM) 
;stopwaitsecs=10    ; max num secs to wait b4 SIGKILL (default 10) 
;stopasgroup=true    ; send stop signal to the UNIX process group (default false) 
;killasgroup=true    ; SIGKILL the UNIX process group (def false) 
user=userkdo     ; setuid to this UNIX account to run the program 
;redirect_stderr=true   ; redirect proc stderr to stdout (default false) 
stdout_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.log  ; stdout log path, NONE for none; default AUTO 
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stdout_logfile_backups=10  ; # of stdout logfile backups (default 10) 
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stdout_events_enabled=false ; emit events on stdout writes (default false) 
stderr_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.err  ; stderr log path, NONE for none; default AUTO 
stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stderr_logfile_backups=10  ; # of stderr logfile backups (default 10) 
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stderr_events_enabled=false ; emit events on stderr writes (default false) 
;environment=A="1",B="2"  ; process environment additions (def no adds) 
;serverurl=AUTO    ; override serverurl computation (childutils) 





[program:Sitbot1_1_7] 
command=/usr/local/bin/php -f process.php 1 7 16 18   ; the program (relative uses PATH, can take args) 
process_name=%(program_name)s_%(process_num)02d ; process_name expr (default %(program_name)s) 
numprocs=3     ; number of processes copies to start (def 1) 
directory=/home/userkdo/domains/domain/public_html/bot1    ; directory to cwd to before exec (def no cwd) 
;umask=022      ; umask for process (default None) 
;priority=999     ; the relative start priority (default 999) 
autostart=false    ; start at supervisord start (default: true) 
autorestart=true  ; whether/when to restart (default: unexpected) 
;startsecs=1     ; number of secs prog must stay running (def. 1) 
;startretries=3    ; max # of serial start failures (default 3) 
;exitcodes=0,2     ; 'expected' exit codes for process (default 0,2) 
;stopsignal=TERM    ; signal used to kill process (default TERM) 
;stopwaitsecs=10    ; max num secs to wait b4 SIGKILL (default 10) 
;stopasgroup=true    ; send stop signal to the UNIX process group (default false) 
;killasgroup=true    ; SIGKILL the UNIX process group (def false) 
user=userkdo     ; setuid to this UNIX account to run the program 
;redirect_stderr=true   ; redirect proc stderr to stdout (default false) 
stdout_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.log  ; stdout log path, NONE for none; default AUTO 
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stdout_logfile_backups=10  ; # of stdout logfile backups (default 10) 
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stdout_events_enabled=false ; emit events on stdout writes (default false) 
stderr_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.err  ; stderr log path, NONE for none; default AUTO 
stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stderr_logfile_backups=10  ; # of stderr logfile backups (default 10) 
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stderr_events_enabled=false ; emit events on stderr writes (default false) 
;environment=A="1",B="2"  ; process environment additions (def no adds) 
;serverurl=AUTO    ; override serverurl computation (childutils) 





[program:Sitbot1_1_8] 
command=/usr/local/bin/php -f process.php 1 8 19 22   ; the program (relative uses PATH, can take args) 
process_name=%(program_name)s_%(process_num)02d ; process_name expr (default %(program_name)s) 
numprocs=3     ; number of processes copies to start (def 1) 
directory=/home/userkdo/domains/domain/public_html/bot1    ; directory to cwd to before exec (def no cwd) 
;umask=022      ; umask for process (default None) 
;priority=999     ; the relative start priority (default 999) 
autostart=false    ; start at supervisord start (default: true) 
autorestart=true  ; whether/when to restart (default: unexpected) 
;startsecs=1     ; number of secs prog must stay running (def. 1) 
;startretries=3    ; max # of serial start failures (default 3) 
;exitcodes=0,2     ; 'expected' exit codes for process (default 0,2) 
;stopsignal=TERM    ; signal used to kill process (default TERM) 
;stopwaitsecs=10    ; max num secs to wait b4 SIGKILL (default 10) 
;stopasgroup=true    ; send stop signal to the UNIX process group (default false) 
;killasgroup=true    ; SIGKILL the UNIX process group (def false) 
user=userkdo     ; setuid to this UNIX account to run the program 
;redirect_stderr=true   ; redirect proc stderr to stdout (default false) 
stdout_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.log  ; stdout log path, NONE for none; default AUTO 
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stdout_logfile_backups=10  ; # of stdout logfile backups (default 10) 
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stdout_events_enabled=false ; emit events on stdout writes (default false) 
stderr_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.err  ; stderr log path, NONE for none; default AUTO 
stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stderr_logfile_backups=10  ; # of stderr logfile backups (default 10) 
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stderr_events_enabled=false ; emit events on stderr writes (default false) 
;environment=A="1",B="2"  ; process environment additions (def no adds) 
;serverurl=AUTO    ; override serverurl computation (childutils) 





[program:Sitbot1_1_9] 
command=/usr/local/bin/php -f process.php 1 9 23 26   ; the program (relative uses PATH, can take args) 
process_name=%(program_name)s_%(process_num)02d ; process_name expr (default %(program_name)s) 
numprocs=3     ; number of processes copies to start (def 1) 
directory=/home/userkdo/domains/domain/public_html/bot1    ; directory to cwd to before exec (def no cwd) 
;umask=022      ; umask for process (default None) 
;priority=999     ; the relative start priority (default 999) 
autostart=false    ; start at supervisord start (default: true) 
autorestart=true  ; whether/when to restart (default: unexpected) 
;startsecs=1     ; number of secs prog must stay running (def. 1) 
;startretries=3    ; max # of serial start failures (default 3) 
;exitcodes=0,2     ; 'expected' exit codes for process (default 0,2) 
;stopsignal=TERM    ; signal used to kill process (default TERM) 
;stopwaitsecs=10    ; max num secs to wait b4 SIGKILL (default 10) 
;stopasgroup=true    ; send stop signal to the UNIX process group (default false) 
;killasgroup=true    ; SIGKILL the UNIX process group (def false) 
user=userkdo     ; setuid to this UNIX account to run the program 
;redirect_stderr=true   ; redirect proc stderr to stdout (default false) 
stdout_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.log  ; stdout log path, NONE for none; default AUTO 
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stdout_logfile_backups=10  ; # of stdout logfile backups (default 10) 
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stdout_events_enabled=false ; emit events on stdout writes (default false) 
stderr_logfile=/home/userkdo/domains/domain/public_html/bot1/log/log1.err  ; stderr log path, NONE for none; default AUTO 
stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) 
;stderr_logfile_backups=10  ; # of stderr logfile backups (default 10) 
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0) 
;stderr_events_enabled=false ; emit events on stderr writes (default false) 
;environment=A="1",B="2"  ; process environment additions (def no adds) 
;serverurl=AUTO    ; override serverurl computation (childutils) 

उत्तर

9

इस आशय log rotation कहा जाता है। जब लॉग फ़ाइल stdout_logfile_maxbytes में मान से बड़ी है तो इसकी सामग्री बैकअप के लिए logfile.log.1 में स्थानांतरित हो जाती है। यदि आप इस व्यवहार को बदलना चाहते हैं तो आप:

  • stdout_logfile_maxbytes से 0 का मान बदलें - सभी लॉग एक लॉग फ़ाइल में रखे जाएंगे।
  • stdout_logfile_backups से 0 का मान बदलें - जब लॉग फ़ाइल बहुत बड़ी पुरानी लॉग को अलग फ़ाइल में स्थानांतरित करने के बजाय हटा दिया जाएगा।

वही stderr_logfile_maxbytes और stderr_logfile_backups के अनुसार लागू होता है।

+0

हाँ जो लगता है कि thnx क्या हो रहा है। – Evan

+0

@daniula क्या कोई डिफ़ॉल्ट stdout_logfile_maxbytes है यदि मैं यह मान सेट नहीं करता हूं ?? – tyan

+0

@tyan [दस्तावेज़ीकरण] के अनुसार (http://supervisord.org/configuration.html#program-x-section-values) 'stdout_logfile_maxbytes' के लिए डिफ़ॉल्ट मान 50 एमबी है। – daniula

संबंधित मुद्दे