We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a945759 commit 8450eb0Copy full SHA for 8450eb0
cmd/main.go
@@ -57,10 +57,11 @@ func NewLogWriter(config *Config) *LogWriter {
57
58
// WriteLog writes a log entry to the appropriate file based on ServiceName
59
func (lw *LogWriter) WriteLog(logEntry TraefikLog, rawLog string) error {
60
- // Extract ServiceName
+ // Extract ServiceName, use "unknown" if missing
61
serviceName, ok := logEntry["ServiceName"].(string)
62
if !ok {
63
- return fmt.Errorf("missing or invalid ServiceName field")
+ // Use "unknown" as the service name for logs without ServiceName
64
+ serviceName = "unknown"
65
}
66
67
// Create directory if needed
0 commit comments