What Kevin is Thinking

System Administration, System Optimizing and a little Programming :)
    <<  受宠若惊 | 首 页 | twitter最新IP  >>
  • lighttpd的日志rotate - [技术笔记]

    2009-07-17

    分类: 技术笔记

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://iyubo.blogbus.com/logs/42486409.html

    之前找到的通过logrotate计划任务来截断lighttpd的日志目前看起来并不好用,为了更好的解决lighttpd的日志rotate,找到了cronolog。从其网站转载一段说明:

    cronolog is a simple filter program that reads log file entries from standard input and writes each entry to the output file specified by a filename template and the current date and time. When the expanded filename changes, the current file is closed and a new one opened. cronolog is intended to be used in conjunction with a Web server, such as Apache, to split the access log into daily or monthly logs.

    cronolog is not just limited to rotating web server log files. In fact a community radio station in Montreal, Quebec, (CKUT 90.3 FM) uses it as part of a realtime archive/logging system of the broadcasts using open-source software.

    cronolog的安装

    #cd /data/software/pkg
    #wget -P /data/software/ http://cronolog.org/download/cronolog-1.6.2.tar.gz
    #tar zxvf ../cronolog-1.6.2.tar.gz
    #cd cronolog-1.6.2
    #./configure
    #make && make install

    修改lighttpd配置文件使用cronolog进行日志rotate
    #vi /etc/lighttpd.conf

    server.errorlog             = "|/usr/local/sbin/cronolog /var/log/lighttpd/error/%Y/%m/%d/error.log"

    accesslog.filename          = "|/usr/local/sbin/cronolog /var/log/lighttpd/access/%Y/%m/%d/access.log"

    保存后重启lighttpd使配置生效。如果配置成功,系统进程里将会多出两个cronolog的进程,新的日志将保存在配置目录中按照年月日建立文件夹下


    随机文章:

    lighttpd+modcache实现对小图片的Cache 2009-07-16
    使用Nginx/Lighttpd作为反向代理服务器 2008-06-25
    Varnish无法分配内存导致自动重启子进程的问题 2009-03-11
    Linux下安装SVN服务器 2008-05-27
    解决Cacti无法正常监控超过100M以上流量的问题 2008-05-27

    收藏到:Del.icio.us




    Tag:lighttpd logrotate 日志截断 rotate
    引用地址:
    Kevin 发表于13:34:31 | 编辑 | 继续话题 | 转发 | 分享 0
立即注册PayPal并开始接受信用卡付款。

搜索

feedsky
抓虾
google reader
my yahoo
鲜果
有道
九点

最新日志

  • Varnish升级到2.0.5
  • Ubuntu 9.10禁用“最近的文档”
  • 在Linux下给网卡做bond
  • Farewell All
  • [TED]吉米·威尔斯叙说Wikipedia(维基百科)的诞生
  • 我的第一个TED Talk Translation
  • twitter最新IP
  • lighttpd的日志rotate
  • 受宠若惊
  • lighttpd+modcache实现对小图片的Cache
全部日志>>

最新评论

  • sery:Kevin回复sery说: 我还没遇到过这个问题,不过...
  • sery:谢谢回复。 我现在用了64位的系统,但执行 varni...
  • sery:varnish 在32位的系统只能到2G。请问你怎么到的...
  • 稀饭:你的Varnish并发到4w后dmesg会出现 TCP...
  • Tina:回来了,也无法联系你了哈,呵呵,邮件也没有人回呀,等你消...
  • Tina:博主,怎么联系你呢,我给你发了EMAIL...
  • niule:谢谢,确实是-w参数会有问题,调整了就可以了! thx...
  • beibei.shi:余哥,祝您在那里一切顺利,很感谢您的指点,感激不尽!...
  • 奥德:很高兴认识你,有重要问题请教你,关于apache日志导成...
  • snow:....不会吧 混了几年也不觉得啊...

Tag

  • linux[61]
  • shell[20]
  • varnish[10]
  • cache[9]
  • programming[9]
  • unix[9]
  • 监控[8]
  • nagios[7]
More..
  • RSS 什么是RSS?
    用IM提醒我内容更新
    订阅到QQ邮箱
    订阅到鲜果阅读器
    订阅到Google阅读器
    订阅到抓虾阅读器
  • 《城客》第四期:创意之城
    博客大巴
    博客大巴使用指南
    博客大巴模板中心
    免费注册博客大巴
    一键博客搬家工具
    中文互动杂志城客
Copyright © 2002-2009 BlogBus.com, All Rights Reserved. 博客大巴 版权所有
博客大巴模板设计:新绿 | 作者: 饭团