Apache HTTP Server �汾2.2
rotatelogs
��һ�����Apache�ܵ���־����ʹ�õļ�������
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()
�ĸ�ʽ�ַ������������ᱻ�Զ���������Ϊ��λ��".nnnnnnnnnn"���������ָ�ʽ����ʾ�µ���־��ʼʹ�õ�ʱ�䡣rotationtime
offset
-300
"��filesizeM
filesizeM
�ļ���С�����������ǰ���ʱ���ʱ�������������־�ļ���ʽ�ַ�������Ϊ���е�strftime()
ʵ����֧�֣���������չ���Ӧ��strftime()
���ֲᡣ
%A | ������ȫ��(���ص�) |
%a | 3���ַ���������(���ص�) |
%B | �·�����ȫ��(���ص�) |
%b | 3���ַ����·���(���ص�) |
%c | ���ں�ʱ��(���ص�) |
%d | 2λ����һ�����е������� |
%H | 2λ����Сʱ��(24Сʱ��) |
%I | 2λ����Сʱ��(12Сʱ��) |
%j | 3λ����һ���е������� |
%M | 2λ���ķ����� |
%m | 2λ�����·��� |
%p | am/pm12Сʱ�Ƶ�������(���ص�) |
%S | 2������� |
%U | 2λ����һ���е�������(������Ϊһ�ܵĵ�һ��) |
%W | 2λ����һ���е�������(����һΪһ�ܵĵ�һ��) |
%w | 1λ�������ڼ�(������Ϊһ�ܵĵ�һ��) |
%X | ʱ��(���ص�) |
%x | ����(���ص�) |
%Y | 4������ |
%y | 2������ |
%Z | ʱ���� |
%% | ����"%"���� |