-
Notifications
You must be signed in to change notification settings - Fork 49
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
add env for logging to file and syslog #46
Conversation
oldlog.go
Outdated
if err != nil { | ||
fmt.Printf("ERROR go-log: %s: failed to set logging file backend\n", err) | ||
} | ||
lgbe = append(lgbe, logging.NewLogBackend(f, "", 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the above errors, we don't want to add this backend. it will be to a bad file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doh! thanks
oldlog.go
Outdated
if logfp := os.Getenv(envLoggingFile); len(logfp) > 0 { | ||
f, err := os.Create(logfp) | ||
if err != nil { | ||
fmt.Printf("ERROR go-log: %s: failed to set logging file backend\n", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should at least use stderr. Ideally, we'd log it but it may be too early for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed - will write to stderr, I think it may be too early to log here.
e956af0
to
29c2a5b
Compare
What's this?
GOLOG_FILE
GOLOG_SYSLOG_ENABLE