1
0
mirror of https://github.com/golang/go synced 2024-11-26 13:08:08 -07:00
go/src
John Graham-Cumming 4228eb7915 log/syslog: correct message format
The syslog implementation was not correctly implementing the
traditional syslog format because it had a confused notion of
'priority'.  syslog priority is not a single number but is, in
fact, the combination of a facility number and a severity. The
previous Go syslog implementation had a single Priority that
appeared to be the syslog severity and no way of setting the
facility.  That meant that all syslog messages from Go
programs appeared to have a facility of 0 (LOG_KERN) which
meant they all appeared to come from the kernel.

Also, the 'prefix' was in fact the syslog tag (changed the
internal name for clarity as the term tag is more widely used)
and the timestamp and hostname values were missing from
messages.

With this change syslog messages are generated in the correct
format with facility and severity combined into a priority,
the timestamp in RFC3339 format, the hostname, the tag (with
the PID in [] appened) and the message.

The format is now:

   <PRI>1 TIMESTAMP HOSTNAME TAG[PID]: MSG

The TIMESTAMP, HOSTNAME and PID fields are filled in
automatically by the package. The TAG and the MSG are supplied
by the user. This is what rsyslogd calls TraditionalFormat and
should be compatible with multiple systems.

R=rsc, jgc, 0xjnml, mikioh.mikioh, bradfitz
CC=golang-dev
https://golang.org/cl/6782118
2012-11-27 10:21:43 -05:00
..
cmd cmd/gc: add division rewrite to walk pass. 2012-11-26 23:45:22 +01:00
lib9 lib9: remove unreferenced externs and getuser() 2012-11-08 09:39:24 -05:00
libbio
libmach libmach, cmd/cc, cmd/cov, cmd/ld, cmd/prof: check malloc return value 2012-11-27 03:05:46 +08:00
pkg log/syslog: correct message format 2012-11-27 10:21:43 -05:00
all.bash
all.bat
all.rc
clean.bash
clean.bat
clean.rc
make.bash
make.bat
Make.dist
make.rc
run.bash run.bash: fix linux/arm build 2012-11-15 13:59:46 +11:00
run.bat run.{bash,bat,rc}: unset GOMAXPROCS before ../test 2012-11-15 11:40:10 +11:00
run.rc run.{bash,bat,rc}: unset GOMAXPROCS before ../test 2012-11-15 11:40:10 +11:00
sudo.bash sudo.bash: diagnose when the go tool is not in $PATH 2012-11-15 10:42:39 -08:00