Support specifying a specific logrus log level for shim log output#1058
Support specifying a specific logrus log level for shim log output#1058dcantah merged 1 commit intomicrosoft:masterfrom
Conversation
|
So this is annoying as we already have the debug option. What's our policy on deprecating/breaking existing options? Because as of now there's the redundant debug field that I'm just overriding if they specified Edit: After consulting, we'll keep debug and just log a warning (hopefully the level the user chose is below this :P) if they were both specified. LogLevel will override debug |
|
|
||
| // log_level specifies the logrus log level for the shim. Supported values are a string representation of the | ||
| // logrus log levels: "trace", "debug", "info", "warn", "error", "fatal", "panic". | ||
| string log_level = 16; |
There was a problem hiding this comment.
I know we have code explaining the relationship between log_level and debug, but could we add a comment for log_level also?
Sometimes debug is a bit too noisy and can cause log rotation at a higher than ideal rate. This will be accompanied by an audit of our use of log levels throughout to make sure they actually fit what level they're under. Signed-off-by: Daniel Canter <dcanter@microsoft.com>
| string NCProxyAddr = 15; | ||
|
|
||
| // log_level specifies the logrus log level for the shim. Supported values are a string representation of the | ||
| // logrus log levels: "trace", "debug", "info", "warn", "error", "fatal", "panic". This setting will override |
There was a problem hiding this comment.
do we want to make an enum for this?
There was a problem hiding this comment.
I didn't want to have to supply 0-n for the setting in the containerd config, it seems more intuitive to supply "debug", "warning" etc. as a user then have to remember/figure out what number corresponds to what level. Also makes it so you can feed the string directly to logrus
Related work items: microsoft#930, microsoft#962, microsoft#1004, microsoft#1008, microsoft#1039, microsoft#1045, microsoft#1046, microsoft#1047, microsoft#1052, microsoft#1053, microsoft#1054, microsoft#1057, microsoft#1058, microsoft#1060, microsoft#1061, microsoft#1063, microsoft#1064, microsoft#1068, microsoft#1069, microsoft#1070, microsoft#1071, microsoft#1074, microsoft#1078, microsoft#1079, microsoft#1081, microsoft#1082, microsoft#1083, microsoft#1084, microsoft#1088, microsoft#1090, microsoft#1091, microsoft#1093, microsoft#1094, microsoft#1096, microsoft#1098, microsoft#1099, microsoft#1102, microsoft#1103, microsoft#1105, microsoft#1106, microsoft#1108, microsoft#1109, microsoft#1115, microsoft#1116, microsoft#1122, microsoft#1123, microsoft#1126
Sometimes debug is a bit too noisy and can cause log rotation at a higher than
ideal rate.
This will be accompanied by an audit of our use of log levels throughout to make sure
they actually fit what level they're under.
This will be a new runtime config option for the shim, and the supported values are the seven logrus log levels.
Example:
Signed-off-by: Daniel Canter dcanter@microsoft.com