-
Notifications
You must be signed in to change notification settings - Fork 716
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 message severity isn't properly reported in stackdriver #864
Comments
I had similar problem. By default stackdriver assigns severity based on target stream (so for example: logs captured from stdout get severity "info" and ones from stderr get "error"). Python logging module's default handler sends all logs to stderr (even those with INFO level), that's why all of them has "error" severity in stackdriver. |
We are not using python logging package in tf-operator, I think. We are using "github.com/sirupsen/logrus" and its default output is STDERR. It should be easy to fix. // Creates a new logger. Configuration should be set by changing `Formatter`,
// `Out` and `Hooks` directly on the default logger instance. You can also just
// instantiate your own:
//
// var log = &Logger{
// Out: os.Stderr,
// Formatter: new(JSONFormatter),
// Hooks: make(LevelHooks),
// Level: logrus.DebugLevel,
// }
//
// It's recommended to make this a global instance called `log`.
func New() *Logger {
return &Logger{
Out: os.Stderr,
Formatter: new(TextFormatter),
Hooks: make(LevelHooks),
Level: InfoLevel,
ExitFunc: os.Exit,
ReportCaller: false,
}
} |
After #1088 is merged, I can have a look. |
/kind bug |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Issue Label Bot is not confident enough to auto-label this issue. |
Below are the TFJob operator logs fetched with the following query.
The log prints out the severity as reported in stackdriver as well as the level in the json message. The level indicates they are info level log messages but they are logged as severity error in stackdriver.
trainer-logs-1106.txt
The text was updated successfully, but these errors were encountered: