<-
Apache > HTTP Server > Documentation > Version 2.2 > Programs

Please note

This document refers to a legacy release (2.2) of Apache httpd. The active release (2.4) is documented here. If you have not already upgraded, please follow this link for more information.

You may follow this link to go to the current version of this document.

rotatelogs - ¾ÆÆÄÄ¡ ·Î±×¸¦ ¼øȯÇϱâÀ§ÇØ ÆÄÀÌÇÁ·Î ¿¬°áÇÒ ·Î±× ÇÁ·Î±×·¥

°¡´ÉÇÑ ¾ð¾î:  en  |  ko  |  tr 

ÀÌ ¹®¼­´Â ÃÖ½ÅÆÇ ¹ø¿ªÀÌ ¾Æ´Õ´Ï´Ù. ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼­¸¦ Âü°íÇϼ¼¿ä.

rotatelogs´Â ¾ÆÆÄÄ¡ÀÇ ÆÄÀÌÇÁ ·Î±×ÆÄÀÏ ±â´ÉÀ» À§ÇÑ °£´ÜÇÑ ÇÁ·Î±×·¥ÀÌ´Ù. ¿¹¸¦ µé¾î:

CustomLog "|bin/rotatelogs /var/logs/logfile 86400" common

±×·¯¸é /var/logs/logfile.nnnn ÆÄÀÏÀ» ¸¸µç´Ù. nnnnÀº ·Î±×¸¦ ½ÃÀÛÇÑ ½Ã½ºÅ۽ð£ÀÌ´Ù (ÀÌ ½Ã°£Àº Ç×»ó ¼øȯ±â°£ÀÇ ¹è¼öÀÌ´Ù. ±×·¡¼­ cron ½ºÅ©¸³Æ®·Î ó¸®Çϱ⠽±´Ù). ¼øȯ±â°£ (¿©±â¼­´Â 24 ½Ã°£) ¸¶´Ù »õ·Î¿î ·Î±×¸¦ ½ÃÀÛÇÑ´Ù.

CustomLog "|bin/rotatelogs /var/logs/logfile 5M" common

ÀÌ ¼³Á¤Àº ·Î±×ÆÄÀÏ Å©±â°¡ 5 ¸Þ°¡¹ÙÀÌÆ®°¡ µÉ¶§¸¶´Ù ¼øȯÇÑ´Ù.

ErrorLog "|bin/rotatelogs /var/logs/errorlog.%Y-%m-%d-%H_%M_%S 5M"

ÀÌ ¼³Á¤Àº ¿À·ù·Î±× ÆÄÀÏ Å©±â°¡ 5 ¸Þ°¡¹ÙÀÌÆ®°¡ µÉ¶§¸¶´Ù errorlog.YYYY-mm-dd-HH_MM_SS¿Í °°Àº ÆÄÀÏÀ» ¸¸µé¾î¼­ ¿À·ù·Î±× ÆÄÀÏÀ» ¼øȯÇÑ´Ù.

top

°³¿ä

rotatelogs [ -l ] logfile [ rotationtime [ offset ]] | [ filesizeM ]

top

¿É¼Ç

-l
¼øȯÁÖ±â·Î GMT ´ë½Å Áö¿ª½Ã°£À» »ç¿ëÇÑ´Ù. (BST³ª DST¿Í °°ÀÌ) GMT ½Ã°£Â÷°¡ º¯Çϴ ȯ°æ¿¡¼­ -lÀ» »ç¿ëÇÏ¸é ¿¹±âÄ¡ ¾ÊÀº °á°ú°¡ ¹ß»ýÇÒ ¼ö ÀÖ´Ù!
logfile
·Î±×ÆÄÀÏÀÇ °æ·Î¿Í À̸§. logfile¿¡ '%' ¹®ÀÚ°¡ ÀÖ´Ù¸é strftime(3)ÀÇ Çü½Ä¹®ÀÚ¿­°ú °°ÀÌ Ã³¸®ÇÑ´Ù. '%' ¹®ÀÚ°¡ ¾ø´Ù¸é µÚ¿¡ ÃÊ´ÜÀ§ ½Ã°£ .nnnnnnnnnnÀ» ÀÚµ¿À¸·Î ºÙÀδÙ. µÎ Çü½Ä ¸ðµÎ ÇöÀç ±â°£ºÎÅÍ ½ÃÀ۽ð£À» °è»êÇÑ´Ù.
rotationtime
·Î±×ÆÄÀÏÀ» ¼øȯÇÒ ÃÊ´ÜÀ§ ½Ã°£.
offset
UTC¿¡¼­ ºÐ´ÜÀ§ ½Ã°£Â÷ÀÌ. »ý·«Çϸé 0À¸·Î °¡Á¤ÇÏ¿© UTC¸¦ »ç¿ëÇÑ´Ù. ¿¹¸¦ µé¾î, UTC -5 ½Ã°£´ëÀÇ Áö¿ª½Ã°£À» »ç¿ëÇÑ´Ù¸é ¾Æ±Ô¸ÕÆ®·Î -300À» ÁöÁ¤ÇÑ´Ù.
filesizeM
½Ã°£ÀÌ ¾Æ´Ñ Å©±â¸¦ ÁöÁ¤ÇÒ¶§ ¸Þ°¡¹ÙÀÌÆ®´ÜÀ§ ÃÖ´ë ÆÄÀÏÅ©±â µÚ¿¡ MÀ» ºÙÀδÙ. rotationtime°ú offset ´ë½Å ÀÌ ÆĶó¹ÌÅ͸¦ »ç¿ëÇÑ´Ù.
top

Æ÷Æð¡´É¼º

´ÙÀ½ ·Î±×ÆÄÀÏ Çü½Ä¹®ÀÚ¿­ Ç¥ÇöÀº ¸ðµç strftime(3) ±¸ÇöÀÌ Áö¿øÇØ¾ß ÇÑ´Ù. ¶óÀ̺귯¸® ƯÀ¯ÀÇ È®ÀåÀº strftime(3) manpage¸¦ Âü°íÇ϶ó.

%A(Áö¿ªÈ­µÈ) ¿ÏÀüÇÑ ¿äÀÏ À̸§
%a(Áö¿ªÈ­µÈ) 3-¹®ÀÚ ¿äÀÏ À̸§
%B(Áö¿ªÈ­µÈ) ¿ÏÀüÇÑ ´Þ À̸§
%b(Áö¿ªÈ­µÈ) 3-¹®ÀÚ ´Þ À̸§
%c(Áö¿ªÈ­µÈ) ³¯Â¥¿Í ½Ã°£
%d2-ÀÚ¸® ÀÏ
%H2-ÀÚ¸® ½Ã°£ (24 ½Ã°£ ½Ã°è)
%I2-ÀÚ¸® ½Ã°£ (12 ½Ã°£ ½Ã°è)
%j3-ÀÚ¸® ³¯Â¥¼ö
%M2-ÀÚ¸® ºÐ
%m2-ÀÚ¸® ´Þ
%p(Áö¿ªÈ­µÈ) 12 ½Ã°£ ½Ã°èÀÇ am/pm
%S2-ÀÚ¸® ÃÊ
%U2-ÀÚ¸® ÁÖÀϼö (ÁÖÀÇ Ã¹¹øÀç ³¯Àº ÀÏ¿äÀÏ)
%W2-ÀÚ¸® ÁÖÀϼö (ÁÖÀÇ Ã¹¹øÀç ³¯Àº ¿ù¿äÀÏ)
%w1-ÀÚ¸® ¿äÀϼö (ÁÖÀÇ Ã¹¹ø° ³¯Àº ÀÏ¿äÀÏ)
%X(Áö¿ªÈ­µÈ) ½Ã°£
%x(Áö¿ªÈ­µÈ) ³¯Â¥
%Y4-ÀÚ¸® ¿¬µµ
%y2-ÀÚ¸® ¿¬µµ
%Z½Ã°£´ë À̸§
%%¹®ÀÚ±×´ë·Î `%'

°¡´ÉÇÑ ¾ð¾î:  en  |  ko  |  tr 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.