mirror of
https://github.com/amir20/dozzle.git
synced 2026-06-23 04:10:12 +00:00
feat: support log.level JSON key for level detection (#4564)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ var singleLetterBracket = regexp.MustCompile(`\[([EWIDFTV])\]`)
|
||||
var timestampRegex = regexp.MustCompile(`^(?:\d{4}[-/]\d{2}[-/]\d{2}(?:[T ](?:\d{2}:\d{2}:\d{2}(?:\.\d+)?Z?|\d{2}:\d{2}(?:AM|PM)))?\s+)`)
|
||||
|
||||
// JSON keys to check for log level (in priority order).
|
||||
var levelKeys = []string{"@l", "level", "severity"}
|
||||
var levelKeys = []string{"@l", "level", "log.level", "severity"}
|
||||
|
||||
func init() {
|
||||
SupportedLogLevels = make(map[string]struct{}, len(logLevels)+1)
|
||||
|
||||
@@ -75,11 +75,16 @@ func FromProto(c *pb.Container) Container {
|
||||
})
|
||||
}
|
||||
|
||||
labels := c.Labels
|
||||
if labels == nil {
|
||||
labels = make(map[string]string)
|
||||
}
|
||||
|
||||
return Container{
|
||||
ID: c.Id,
|
||||
Name: c.Name,
|
||||
Image: c.Image,
|
||||
Labels: c.Labels,
|
||||
Labels: labels,
|
||||
Group: c.Group,
|
||||
Created: c.Created.AsTime(),
|
||||
State: c.State,
|
||||
|
||||
Reference in New Issue
Block a user