This week I worked on rsyslog research and management. The work on terraform-provider-ucloud is postponed.

rsyslog

  • Use template in output action

    $template PJL_Format,"%timegenerated%|%HOSTNAME%|%syslogtag%|%msg%\n"
    $template PJL_File,"/tmp/local-%programname%.log"
    local6,local7.* ?PJL_File;PJL_Format
    
  • Use tag to filter log. Facilities are fixed and cannot add new custom facility, but app can specify arbitrary tag. The tag format is programname[PROCID]

  • Syslog::Logger in Ruby reserves higher priorities (crit, alert and emerge) for system message. The mapping to Logger severity is one level lower:

    • Ruby -> syslog
    • debug -> debug
    • info -> info
    • warn -> notice
    • error -> warning
    • fatal -> err
  • Ruby 2.0 cannot specify facility when creating Syslog::Logger, 2.2 has the third parameter to specify the facility.

  • 20.2. Basic Configuration of Rsyslog via Redhat

Game

Management

Misc