Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(548)

Issue 6782118: code review 6782118: log/syslog: correct message format (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by jgc
Modified:
11 years, 2 months ago
Reviewers:
CC:
rsc, jgc_jgc.org, 0xjnml, mikio, bradfitz, golang-dev
Visibility:
Public.

Description

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.

Patch Set 1 #

Patch Set 2 : diff -r 03a6b8c9c396 https://code.google.com/p/go #

Patch Set 3 : diff -r 03a6b8c9c396 https://code.google.com/p/go #

Patch Set 4 : diff -r c200281fac50 https://code.google.com/p/go #

Total comments: 6

Patch Set 5 : diff -r c200281fac50 https://code.google.com/p/go #

Total comments: 25

Patch Set 6 : diff -r c200281fac50 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -76 lines) Patch
M src/pkg/log/syslog/syslog.go View 1 2 3 4 5 4 chunks +107 lines, -52 lines 0 comments Download
M src/pkg/log/syslog/syslog_test.go View 1 2 3 4 5 6 chunks +53 lines, -24 lines 0 comments Download

Messages

Total messages: 24
jgc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
11 years, 4 months ago (2012-11-26 13:33:36 UTC) #1
rsc
I'm sorry, but the Go 1 compatibility promise means we cannot remove existing types. functions, ...
11 years, 4 months ago (2012-11-26 14:35:36 UTC) #2
jgc_jgc.org
On Mon, Nov 26, 2012 at 2:35 PM, <rsc@golang.org> wrote: > One possibility is to ...
11 years, 4 months ago (2012-11-26 14:45:45 UTC) #3
rsc
> but should work. The only thing I don't like is that you've swapped LOG_USER ...
11 years, 4 months ago (2012-11-26 14:58:15 UTC) #4
jgc_jgc.org
On Mon, Nov 26, 2012 at 2:58 PM, Russ Cox <rsc@golang.org> wrote: > > but ...
11 years, 4 months ago (2012-11-26 15:02:52 UTC) #5
rsc
> I think it's well within the goal of backwards compatibility to not change > ...
11 years, 4 months ago (2012-11-26 15:04:15 UTC) #6
jgc_jgc.org
On Mon, Nov 26, 2012 at 3:04 PM, Russ Cox <rsc@golang.org> wrote: > > I ...
11 years, 4 months ago (2012-11-26 15:07:51 UTC) #7
0xjnml
On Mon, Nov 26, 2012 at 4:02 PM, John Graham-Cumming <jgc@jgc.org> wrote: > I think ...
11 years, 4 months ago (2012-11-26 15:08:43 UTC) #8
mikio
How about another option; making new packet go.net/syslog that implements RFC 5424 The Syslog Protocol? ...
11 years, 4 months ago (2012-11-26 15:29:00 UTC) #9
jgc
Hello rsc@golang.org, jgc@jgc.org, 0xjnml@gmail.com, mikioh.mikioh@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 4 months ago (2012-11-26 15:29:29 UTC) #10
jgc_jgc.org
I've updated the CL so that it is backwards-compatible and uses ORing of the severity ...
11 years, 4 months ago (2012-11-26 15:32:29 UTC) #11
bradfitz
https://codereview.appspot.com/6782118/diff/11001/src/pkg/log/syslog/syslog.go File src/pkg/log/syslog/syslog.go (right): https://codereview.appspot.com/6782118/diff/11001/src/pkg/log/syslog/syslog.go#newcode28 src/pkg/log/syslog/syslog.go:28: delete this line, otherwise the preceding comment isn't attached ...
11 years, 4 months ago (2012-11-26 16:19:55 UTC) #12
jgc
Hello rsc@golang.org, jgc@jgc.org, 0xjnml@gmail.com, mikioh.mikioh@gmail.com, bradfitz@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 4 months ago (2012-11-26 16:39:43 UTC) #13
jgc_jgc.org
I have incorporated all bradfitz's suggested changes. John.
11 years, 4 months ago (2012-11-26 16:40:17 UTC) #14
rsc
Getting close, thanks. https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go File src/pkg/log/syslog/syslog.go (right): https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode22 src/pkg/log/syslog/syslog.go:22: // severity. To set the facility ...
11 years, 4 months ago (2012-11-26 17:07:58 UTC) #15
jgc
https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go File src/pkg/log/syslog/syslog.go (right): https://codereview.appspot.com/6782118/diff/3004/src/pkg/log/syslog/syslog.go#newcode22 src/pkg/log/syslog/syslog.go:22: // severity. To set the facility and severity merge ...
11 years, 4 months ago (2012-11-26 17:24:08 UTC) #16
jgc
Hello rsc@golang.org, jgc@jgc.org, 0xjnml@gmail.com, mikioh.mikioh@gmail.com, bradfitz@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 4 months ago (2012-11-26 17:25:36 UTC) #17
rsc
Looks good except that I'd still like to expand the shift count (or understand why ...
11 years, 4 months ago (2012-11-26 20:46:51 UTC) #18
jgc_jgc.org
On Mon, Nov 26, 2012 at 8:46 PM, <rsc@golang.org> wrote: > Looks good except that ...
11 years, 4 months ago (2012-11-26 21:26:59 UTC) #19
rsc
Wow. I had no idea that was the RFC encoding when I suggested it earlier ...
11 years, 4 months ago (2012-11-26 21:55:13 UTC) #20
jgc_jgc.org
On Mon, Nov 26, 2012 at 9:55 PM, Russ Cox <rsc@golang.org> wrote: > Wow. I ...
11 years, 4 months ago (2012-11-27 07:50:35 UTC) #21
rsc
LGTM
11 years, 4 months ago (2012-11-27 15:21:27 UTC) #22
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=a041b45cc418 *** log/syslog: correct message format The syslog implementation was not correctly ...
11 years, 4 months ago (2012-11-27 15:22:59 UTC) #23
jgc
11 years, 2 months ago (2013-01-04 14:44:51 UTC) #24
*** Abandoned ***
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b