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:
Amir Raminfar
2026-03-25 13:46:08 -07:00
committed by GitHub
parent 2380c87bb0
commit fd943272f0
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -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)
+6 -1
View File
@@ -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,