<-
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.
Comments are disabled for this page at the moment.