一、简介

rotatelogs 是 Apache 自带的管道日志程序,可以完美的实现日志的轮转功能。

二、语法

Usage: rotatelogs [-v] [-l] [-L linkname] [-p prog] [-f] [-t] [-e] [-c] <logfile> {<rotation time in seconds>|<rotation size>(B|K|M|G)} [offset minutes from UTC]

Add this:

TransferLog "|rotatelogs /some/where 86400"

or 

TransferLog "|rotatelogs /some/where 5M"

to httpd.conf. By default, the generated name will be
<logfile>.nnnn where nnnn is the system time at which the log
nominally starts (N.B. if using a rotation time, the time will
always be a multiple of the rotation time, so you can synchronize
cron scripts with it). If <logfile> contains strftime conversion
specifications, those will be used instead. At the end of each
rotation time or when the file size is reached a new log is
started. Options:
-v Verbose operation. Messages are written to stderr.
-l Base rotation on local time instead of UTC.
-L path Create hard link from current log to specified path.
-p prog Run specified program after opening a new log file. See below.
-f Force opening of log on program start.
-t Truncate logfile instead of rotating, tail friendly.
-e Echo log to stdout for further processing.
-c Create log even if it is empty. The program is invoked as "[prog] <curfile> [<prevfile>]"
where <curfile> is the filename of the newly opened logfile, and
<prevfile>, if given, is the filename of the previously used logfile.

三、实例

最新文章

  1. 阿里云服务器的坑=====部署EF+MVC
  2. iOS9,导航控制器中的子控制器设置StatusBar状态失效的问题
  3. cutpFTP设置步骤
  4. android system.img
  5. 转!! Java中如何遍历Map对象的4种方法
  6. iOS夯实:内存管理
  7. svn自动更新web服务器
  8. Pjax介绍及在asp.net MVC3中使用pjax的简单示例
  9. Bzoj 1598: [Usaco2008 Mar]牛跑步 dijkstra,堆,K短路,A*
  10. hdu 2034
  11. Arch安装fcitx输入法
  12. 深入探究stm32GPIO口模式(类比51)
  13. 本地服务器 windows server 2008 datacenter conn /as sysdba 提示 ora-01031 insufficient privileges
  14. java.util.HashSet, java.util.LinkedHashMap, java.util.IdentityHashMap 源码阅读 (JDK 1.8)
  15. Servlet--ServletContext接口
  16. 单台PC玩转NEUTRON(一:环境准备)
  17. A7架构
  18. Vscode设置个人爱好
  19. 排序与相关性(Sorting and Relevance)
  20. cactiez中文版10.1配置监控系统安装笔记

热门文章

  1. python之Beautiful Soup库
  2. python manage.py makemigrations生成数据变化的问题
  3. 关于djangoadmin的一个博客
  4. nodejs 中的 NODE_PATH
  5. The java.util.concurrent Synchronizer Framework笔记
  6. loadrunner 学习 1 —— 关于loadrunner的安装/破解
  7. mongdb与mysql的联系和区别
  8. maven学习5 构建MyBatis项目
  9. 当我们谈 SQL 优化时在谈些什么?
  10. Bind(&quot;入库日期&quot;, &quot;{0:yyyy-MM-dd}&quot;) 关于asp.net格式化数据库日期字符串