52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
  • 伐AI璁函移瘛怠伐
     
亦: 4584|敺: 0
銝銝銝駁 銝銝銝駁

[nginx|php-fpm] nginxlog瑼瘝鋡怨芸憯蝮桀隞

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2016-11-3 16:51:30 | 芰閰脖 撣 |摨閬 |梯璅∪
砍敺 IT_man 2016-11-3 21:24 蝺刻摩
3 A0 E& `4 M: J: d% Z& l) z2 p6 j; A3 L" O: b' Q
CentOS銝nginxlog瑼曉/var/log/nginx,雿亦餅鋡怨芸脖蒂憯蝮.* f( ?: m: R# `& @! F% O
曆google潛曉靘蝻箏鈭/etc/logrotate.d/nginx瑼,抒摰鋆nginx閰脫芸Y甇斗,箔銝芸Y,航賣臬鋆箔撌桅.# w5 x% L$ Z+ c9 m
潭臭敺亙酒erver銴鋆賡靘,摰.6 ]6 |5 B' \+ |. D) L9 A# V

0 r, S9 P5 t2 d5 R
9 D- t" E8 t, q: t1 P
$ s' b$ `5 P9 \$ q# g" E( {2 U
隞乩隤芣亥蝞∠logrotate雿:1 z/ H: }/ N( t( W5 r8 D
6 `+ _" [( P: ]' S! ^' R3 Z$ e

% O, f) U! h! z) g( ^3 F摸ginx典鋆乩銝logrotate隞餃: /etc/logrotate.d/nginx
, m! b: ~" ~. n/var/log/nginx/*.log {
3 A$ x6 s$ V+ j. w4 F0 I8 Z" Z  @        daily / A3 Q5 d+ k  H, M. h1 @0 L
        missingok   E' |. i8 G3 M7 G+ k
        rotate 52 % L; n1 x3 k" g8 |
        compress - C: A9 W$ G2 `/ }  {
        delaycompress . }/ y* [& Z+ n$ v
        notifempty 4 ~' D% R1 b" q2 V. H$ J
        create 640 nginx adm 4 ^1 V; A* E; L# q1 i
        sharedscripts
3 W8 H/ J$ m, m6 Z, b0 ~        postrotate
% r" |& B& ~3 o' Y; F                [ -f /var/run /nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
5 v* k: j2 U3 J' g) n        endscript
0 o' h/ J( I2 ]4 p$ x" D} & k4 c4 O" F* p6 X' H4 [9 E! D
Linux亥蝞∠logrotate摰霈閰脫隞,寞閮剔蔭亥憭批憭拇詨芷/甇豢亥,撱箇唳亥.
) ?9 X( q5 ^' J/ M0 A% t$ J
9 T/ q' G/ G  `* Q" t7 ^0 b+ Y$ b

8 O0 d: k6 J2 P蝵株牧:
9 w4 F; i- s, ~" `! i& _daily:亥隞嗆憭拚脰皛曉 7 r% p" H  S4 b/ k) N. x, r% \
missingok:憒曆圈log瑼獢,撠勗蕭仿
8 G  y2 O4 b; E! ~6 [3 ~+ brotate:靽餈52甈⊥遝亥
& D1 Q; w( h+ Q2 Q2 k, ?compress:gzip憯蝮株脖誑敺亥 & Z/ a4 [; v6 C8 R' z' k
delaycompress:compress銝韏瑚蝙冽,頧脩亥隞嗅唬銝甈∟脫憯蝮
, e2 `' b/ p1 c! q/ V. Knotifempty憒舐征隞嗥閰,銝頧
% i/ p5 Y: y8 }- U. F) y  ]7 Ucreate mode owner group:頧脫隞,雿輻冽摰隞嗆芋撘撱箇啁亥隞
+ o2 L& u+ f9 e4 ^8 m9 J: tsharedscripts:銵postrotate單(閰脰單砌函箄nginx啁亥隞)
% q; m2 o* l/ r' @4 Hpostrotate/endscript:刻脖誑敺閬瑁賭誘臭誑曉仿餈啣鋆,拙萄敹桃冽銵 $ z9 e7 T/ C$ p1 n- ]

0 W8 X7 `! g" x  n; c; alogrotate閮剛◤亙軏ron/etc/cron.daily銝凋箸乩遙瑁,蝵桀蝢拙: 1 Y' r: `! a' V( L5 k& |
/etc/cron.daily/logrotate
! D% p. H! D4 T& y. e

$ F% ~- p. k; i& I  h% b閬皜祈岫撖怠末閮剖瑼臭誑其誑銝賭誘嚗0 s5 j; m1 q& H1 t2 ^
sudo logrotate -vf /etc/logrotate.d/your-conf-file

( \: ]' v1 ~/ E; Y& p7 D
, V( Z) D: R6 ^5 H5 A  T& y
+ w$ B2 G3 x. h; ?) }; X
3 h0 J: t/ b( h) J5 H
閮:
. l% C" I' |! ~" f:  https://blog.toright.com/posts/4 ... AD%B8%E6%AA%94.html
3 U5 j9 H; ^% A) _
) D# r) W" w8 k) f7 T

雿輻券

祉蝛閬

砍憛批捆靘餉衣雯頝臬批捆蝝颲行粹嗥蝬脩嚗摰撟湔遛嚗嚗甇脖誑銝嗅啣摰嗆摰撟湧翩鈭箏ㄚ孵舫脣伐銝憿亙祉璇甈橘芣遛18甇 雓蝯脣亦閬賬粹脩芣遛18甇脖芣撟渡雯閬賜雯頝臭嗥批捆鞈閮嚗撱箄降典舫脰蝬脰楝批捆蝝蝯蝜ICRA蝝摰鋆閮剖 (粹蝯行霅 祉蝬脣銝蝝瘛函隢憯啣嚗祉閮剜蝞∠)

QQ|撠暺撅||52AV璈A

GMT+8, 2026-1-29 16:31 , Processed in 0.075601 second(s), 19 queries .

蝯∠.撱

[email protected] | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵