V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
ashin
V2EX  ›  Linux

Linux rsyslog中为什嘛有的日志中进程名后面有[pid]而有的没有呢,怎么让所有进程都带pid?

  •  
  •   ashin ·
    axiaoxin · Aug 14, 2013 · 3619 views
    This topic created in 4651 days ago, the information mentioned may be changed or developed.
    请linux牛们看看我这个问题,有syslog文件如下:

    Aug 14 09:02:40 ubuntu anacron[902]: Job `cron.daily' terminated
    Aug 14 09:02:40 ubuntu anacron[902]: Normal exit (1 job run)
    Aug 14 09:03:31 ubuntu AptDaemon: INFO: Quitting due to inactivity
    Aug 14 09:03:31 ubuntu AptDaemon: INFO: Quitting was requested
    Aug 14 09:17:01 ubuntu CRON[2752]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)


    为什么CRON和anacron后面有[pid]而AptDaemon后面没有,现在我想让日志里的每个进程名后面都要跟[pid],这种需求可以实现吗?操作系统是ubuntu12.04,多谢。
    1 replies    1970-01-01 08:00:00 +08:00
    ashin
        1
    ashin  
    OP
       Aug 14, 2013
    囧,在rsyslog的配置文件中添加$SystemLogUsePIDFromSystem on
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5888 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 126ms · UTC 06:14 · PVG 14:14 · LAX 23:14 · JFK 02:14
    ♥ Do have faith in what you're doing.