Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
lusin
V2EX  ›  Linux

请教个LINUX日志问题

  •  
  •   lusin · Mar 31, 2013 · 4141 views
    This topic created in 4967 days ago, the information mentioned may be changed or developed.
    请问在httpd.conf中设置了日志生成文件:/var/log/httpd/access_log

    logrotate中设置了 每天生成一次日志文件

    第一天日志内容写入到 access_log
    第二天日志文件为 access_log access_log-20130331

    但是日志内容写入到 access_log-20130331中而不是 access_log,这是为什么呢?
    4 replies  •  1970-01-01 08:00:00 +08:00
    gamexg
    gamexg
    Mar 31, 2013
    1
    向主进程发送USR1信号
    lusin
    lusin
    OP
    Apr 1, 2013
    2
    什么原理呢?

    你们没遇到过这种情况吗?
    BOYPT
    BOYPT
    Apr 1, 2013
    3
    @lusin 检查/etc/logrotate.d/apache 文件,里面反转了文件后会执行postrotate语句中的命令,一般是发送信号使进程重新打开log文件。

    lz的情况估计是信号发送的语句没起作用。
    lusin
    lusin
    OP
    Apr 1, 2013
    4
    谢谢两位
    可能是没有重启syslog的原因
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1315 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 19:19 · PVG 03:19 · LAX 11:19 · JFK 14:19
    ♥ Do have faith in what you're doing.