Open taotetek opened 7 years ago
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.
@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.
@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.
So, new docs then?
@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
?
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.
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.