Apache HTTP Server Version 2.2
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
´Â ¾ÆÆÄÄ¡ÀÇ ÆÄÀÌÇÁ ·Î±×ÆÄÀÏ ±â´ÉÀ»
À§ÇÑ °£´ÜÇÑ ÇÁ·Î±×·¥ÀÌ´Ù. ¿¹¸¦ µé¾î:
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
¿Í °°Àº ÆÄÀÏÀ»
¸¸µé¾î¼ ¿À·ù·Î±× ÆÄÀÏÀ» ¼øȯÇÑ´Ù.
rotatelogs
[ -l ]
logfile
[ rotationtime [ offset ]] |
[ filesizeM ]
-l
-l
À» »ç¿ëÇÏ¸é ¿¹±âÄ¡
¾ÊÀº °á°ú°¡ ¹ß»ýÇÒ ¼ö ÀÖ´Ù!logfile
strftime(3)
ÀÇ Çü½Ä¹®ÀÚ¿°ú °°ÀÌ Ã³¸®ÇÑ´Ù.
'%' ¹®ÀÚ°¡ ¾ø´Ù¸é µÚ¿¡ ÃÊ´ÜÀ§ ½Ã°£ .nnnnnnnnnnÀ»
ÀÚµ¿À¸·Î ºÙÀδÙ. µÎ Çü½Ä ¸ðµÎ ÇöÀç ±â°£ºÎÅÍ ½ÃÀ۽ð£À» °è»êÇÑ´Ù.rotationtime
offset
-300
À» ÁöÁ¤ÇÑ´Ù.filesizeM
M
À» ºÙÀδÙ. rotationtime°ú offset ´ë½Å ÀÌ
ÆĶó¹ÌÅ͸¦ »ç¿ëÇÑ´Ù.´ÙÀ½ ·Î±×ÆÄÀÏ Çü½Ä¹®ÀÚ¿ Ç¥ÇöÀº ¸ðµç strftime(3)
±¸ÇöÀÌ Áö¿øÇØ¾ß ÇÑ´Ù. ¶óÀ̺귯¸® ƯÀ¯ÀÇ È®ÀåÀº
strftime(3)
manpage¸¦ Âü°íÇ϶ó.
%A | (Áö¿ªÈµÈ) ¿ÏÀüÇÑ ¿äÀÏ À̸§ |
%a | (Áö¿ªÈµÈ) 3-¹®ÀÚ ¿äÀÏ À̸§ |
%B | (Áö¿ªÈµÈ) ¿ÏÀüÇÑ ´Þ À̸§ |
%b | (Áö¿ªÈµÈ) 3-¹®ÀÚ ´Þ À̸§ |
%c | (Áö¿ªÈµÈ) ³¯Â¥¿Í ½Ã°£ |
%d | 2-ÀÚ¸® ÀÏ |
%H | 2-ÀÚ¸® ½Ã°£ (24 ½Ã°£ ½Ã°è) |
%I | 2-ÀÚ¸® ½Ã°£ (12 ½Ã°£ ½Ã°è) |
%j | 3-ÀÚ¸® ³¯Â¥¼ö |
%M | 2-ÀÚ¸® ºÐ |
%m | 2-ÀÚ¸® ´Þ |
%p | (Áö¿ªÈµÈ) 12 ½Ã°£ ½Ã°èÀÇ am/pm |
%S | 2-ÀÚ¸® ÃÊ |
%U | 2-ÀÚ¸® ÁÖÀϼö (ÁÖÀÇ Ã¹¹øÀç ³¯Àº ÀÏ¿äÀÏ) |
%W | 2-ÀÚ¸® ÁÖÀϼö (ÁÖÀÇ Ã¹¹øÀç ³¯Àº ¿ù¿äÀÏ) |
%w | 1-ÀÚ¸® ¿äÀϼö (ÁÖÀÇ Ã¹¹ø° ³¯Àº ÀÏ¿äÀÏ) |
%X | (Áö¿ªÈµÈ) ½Ã°£ |
%x | (Áö¿ªÈµÈ) ³¯Â¥ |
%Y | 4-ÀÚ¸® ¿¬µµ |
%y | 2-ÀÚ¸® ¿¬µµ |
%Z | ½Ã°£´ë À̸§ |
%% | ¹®ÀÚ±×´ë·Î `%' |