Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log/syslog: defaults to LOG_KERN facility #20297

Open
taotetek opened this issue May 9, 2017 · 6 comments
Open

log/syslog: defaults to LOG_KERN facility #20297

taotetek opened this issue May 9, 2017 · 6 comments
Labels
Documentation NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@taotetek
Copy link

taotetek commented May 9, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go1.8 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/bknox/go"
GORACE=""
GOROOT="/home/bknox/.go"
GOTOOLDIR="/home/bknox/.go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build317260052=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

used log/syslog with defaults

From the log/syslog documentation:

"The Priority is a combination of the syslog facility and severity. For example, LOG_ALERT | LOG_FTP sends an alert severity message from the FTP facility. The default severity is LOG_EMERG; the default facility is LOG_KERN."

From RFC3164:

"The Facilities and Severities of the messages are numerically coded
with decimal values. Some of the operating system daemons and
processes have been assigned Facility values. Processes and daemons
that have not been explicitly assigned a Facility may use any of the
"local use" facilities or they may use the "user-level" Facility."

LOG_KERN is a poor default, as nothing should ever be using that facility other than the kernel. LOG_USER would be a more appropriate default facility.

@bradfitz bradfitz changed the title log/syslog defaults to LOG_KERN facility log/syslog: defaults to LOG_KERN facility May 9, 2017
@bradfitz bradfitz added this to the Unplanned milestone May 9, 2017
@bradfitz
Copy link
Contributor

bradfitz commented May 9, 2017

That package is frozen, so unless you can propose a safe fix that doesn't impact existing users much and doesn't add any new API, I think the best we can do is add docs.

@taotetek
Copy link
Author

taotetek commented May 9, 2017

@bradfitz I'll dig into the code - I don't see why any API changes would be necessary, just a change in a default value. I'll look when I get a little time.

@taotetek
Copy link
Author

@bradfitz because of the current implementation, I don't see a good path to fixing this that a) doesn't cause unwanted side effects and b) doesn't add new API. Was worth a look, but unfortunately I don't have a good answer.

@bradfitz
Copy link
Contributor

So, new docs then?

@agnivade
Copy link
Contributor

@bradfitz - I am a bit confused as to what to add in the docs. Should we say that LOG_USER should have been the default facility instead of LOG_KERN. But since this package is frozen, it is being kept as-is ?

@bradfitz
Copy link
Contributor

I'll let others on this bug decide what the appropriate documentation would be. I can help review its wording, but I don't know what content is appropriate.

@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

4 participants