Apache日志轮替规则
<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
TransferLog "|/usr/local/sbin/cronolog /web/apache/logs/%Y%m%daccess_log"
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog "logs/access_log" combined
</IfModule>
在apache的配置文件httpd.conf中找到
ErrorLog logs/error_log及CustomLog logs/access_log common
Linux系统配置方法:
将其改为
ErrorLog “| /usr/local/apache/bin/rotatelogs /home/logs/www/%Y_%m_%d_error_log 86400 480″
CustomLog “| /usr/local/apache/bin/rotatelogs /home/logs/www/%Y_%m_%d_access_log 86400 480″ common
Windows系统下配置方法:
ErrorLog “|bin/rotatelogs.exe logs/site1/error-%y%m%d.log 86400 480″
CustomLog “|bin/rotatelogs.exe logs/site1/access-%y%m%d.log 86400 480″ common
其中common为日志记录格式里设置的名称。
Apache日志轮替规则的更多相关文章
- apache日志轮询技术
1.首先先下载安装apache的日志轮询工具cronolog: wget http://cronolog.org/download/cronolog-1.6.2.tar.gz .tar.gz cd c ...
- Apache日志轮询Cronolog安装及简单用法
安装日志轮询工具cronolog: [root@bqh- tools]# tar xf cronolog-.tar.gz [root@bqh- tools]# cd cronolog- [root@b ...
- linux Apache 日志轮询
安装日志轮询工具 cronolog [root@Nagios-Server tools]# wgethttp://cronolog.org/download/cronolog-1.6.2.tar.gz ...
- apache 日志轮询 linux cronolog
Linux下运行的Web服务器Apache,默认日志文件是不分割的,一个整文件既不易于管理,也不易于分析统计.安装cronolog后,可以将日志文件按时间分割,易于管理和分析. cronolog安装配 ...
- 【处理多服务器日志合并处理问题】多服务器的日志合并统计——apache日志的cronolog轮循
转发:http://www.chedong.com/tech/rotate_merge_log.html 内容摘要:你完全不必耐心地看完下面的所有内容,因为结论无非以下2点:1 用 cronolo ...
- Apache 日志设置不记录指定文件类型的方法和日志轮
Apache日志精准的记录了Web访问的记录,但对于访问量很大的站来说,日志文件过大对于分析和保存很不方便.可以在http.conf(或虚拟主机设置文件httpd-vhosts.conf)中进行设置, ...
- 使用logrotate轮询nginx和apache日志
使用logrotate轮询nginx和apache日志 文章目录 [隐藏] 配置nginx 配置apache 使用logrotate轮询日志很方便,配置也很简单. 配置nginx 1.建立/e ...
- Linux_rsylogd日志轮替(三)
一.轮替规则及配置文件:vi /etc/logrotate.conf 1.如果配置文件中拥有" dateext"参数,那么日志会用日期来作为日志文件的后缀,例如" sec ...
- logrotate关于日志轮询和分割
如果你的是源码包安装的服务,那么对于Linux服务器上的一些服务在运行当中产生的日志很重要,可以判断你的服务是否有异常等,但源码包安装的日志是没有日志的轮询或者说是切割能力的, 所以你就需要用到bas ...
随机推荐
- createjs 的 bitmapdata类
今天测试一个功能,在效率上出现了问题.2D舞台绘制了大量的元素,联想到AS3的 bitmapdata.darw() 功能,遗憾是createjs官方类 中没有bitmapdata类. 好在已经有大神替 ...
- struts(二) ---中参数传值
struts中参数传值的方式有 种: 第一种:直接通过属性来传值 第二种: 第三种:
- CSS使用总结
1.visibility和display的区别: visibility:visible; 显示visibility:hidden; 隐藏,但是保留元素所占的空间display:block; ...
- Spring Boot Admin 的使用 2
http://blog.csdn.net/kinginblue/article/details/52132113 ******************************************* ...
- 临时文件相关的v$tempfile v$sort_usage与V$tempseg_usage
SQL> select username,user,segtype,segfile#,segblk#,extents,segrfno# from v$sort_usage; SEGFILE#代表 ...
- Java后台传前台json数组
function checkStore(){ var flag=1; $.ajax({ url:"widget?type=shop_cart&ajax=yes&action= ...
- OpenCV图像处理中常用函数汇总(2)
// 霍夫线变换 hough vector<Vec2f> lines;//定义一个矢量结构lines用于存放得到的线段矢量集合 HoughLines(dstImage,lines,,CV_ ...
- (33)odoo中产品价格字段
打开product.template 和 product.product 模型发现有很多关于价格描述的字段 product.template: price list_pri ...
- thinkPHP 数字字典
- cmake gcc等安装备案
cmake安装,参照 http://www.cnblogs.com/voyagflyer/p/5323748.html cmake2.8以上 安装后的是/usr/local/bin/cmake -ve ...