You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using Dozzle to view the logs of my (primarily Spring Boot) docker containers locally which works well and looks great 😄. The only thing that has been bugging me is that the log levels are not being picked up properly for the Spring Boot containers and hence filtering by log level.
Logs of container running in v8.10.0
I did a bit of digging and it looks like its because of the guessLogLevel() function in level_guesser.go returning unknown. This is because the logger we are using has the loglevel printed as LL="". I know this may be a fairly untypical logger but I was wondering if there is a possibility of handling this sort of case? Something like the NEW if below?
func guessLogLevel(logEvent *LogEvent) string {
switch value := logEvent.Message.(type) {
case string:
value = stripANSI(value)
value = timestampRegex.ReplaceAllString(value, "")
for _, levelGroup := range logLevels {
first := levelGroup[0]
// Look for the level at the beginning of the message
for _, regex := range plainLevels[first] {
if regex.MatchString(value) {
return first
}
}
// NEW: Look for the level in the middle of the message that are uppercase and surrounded by quotes
if strings.Contains(value, "\""+strings.ToUpper(first)+"\"") {
return first
}
...
I have built the app myself and run and it fixes my problem:
I don't know much about Go or this app so don't know if this would have any wider effect but I'd be grateful if there was some change made. Thank you !
Describe how you would like to see this feature implemented
A solution like the proposed code would be ideal or some other regex that would match this criteria. Or even some mechanism that allows configuration of the what the log-level is surrounded by. i.e. empty space or double quotes etc
Describe any alternatives you've considered
Have thought about changing the logger but I'm not really at liberty to do that and there might be a solution that helps more people than just me.
The text was updated successfully, but these errors were encountered:
Describe the feature you would like to see
I've been using Dozzle to view the logs of my (primarily Spring Boot) docker containers locally which works well and looks great 😄. The only thing that has been bugging me is that the log levels are not being picked up properly for the Spring Boot containers and hence filtering by log level.
Logs of container running in v8.10.0
I did a bit of digging and it looks like its because of the
guessLogLevel()
function inlevel_guesser.go
returning unknown. This is because the logger we are using has the loglevel printed as LL="". I know this may be a fairly untypical logger but I was wondering if there is a possibility of handling this sort of case? Something like the NEW if below?I have built the app myself and run and it fixes my problem:
I don't know much about Go or this app so don't know if this would have any wider effect but I'd be grateful if there was some change made. Thank you !
Describe how you would like to see this feature implemented
A solution like the proposed code would be ideal or some other regex that would match this criteria. Or even some mechanism that allows configuration of the what the log-level is surrounded by. i.e. empty space or double quotes etc
Describe any alternatives you've considered
Have thought about changing the logger but I'm not really at liberty to do that and there might be a solution that helps more people than just me.
The text was updated successfully, but these errors were encountered: