{"record":{"id":"ebb73e3d9393c56f","repo":"cloudflare/cloudflared","slug":"unable-to-unmarshal-loglevel","errorCode":null,"errorMessage":"unable to unmarshal LogLevel","messagePattern":"unable to unmarshal LogLevel","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"management/events.go","lineNumber":184,"sourceCode":"\tdefault:\n\t\treturn \"\"\n\t}\n}\n\nfunc (l LogLevel) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(l.String())\n}\n\nfunc (l *LogLevel) UnmarshalJSON(data []byte) error {\n\tvar s string\n\tif err := json.Unmarshal(data, &s); err != nil {\n\t\treturn errors.New(\"unable to unmarshal LogLevel string\")\n\t}\n\tif level, ok := ParseLogLevel(s); ok {\n\t\t*l = level\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"unable to unmarshal LogLevel\")\n}\n\nconst (\n\t// TimeKey aligns with the zerolog.TimeFieldName\n\tTimeKey = \"time\"\n\t// LevelKey aligns with the zerolog.LevelFieldName\n\tLevelKey = \"level\"\n\t// LevelKey aligns with the zerolog.MessageFieldName\n\tMessageKey = \"message\"\n\t// EventTypeKey is the custom JSON key of the LogEventType in ZeroLogEvent\n\tEventTypeKey = \"event\"\n\t// FieldsKey is a custom JSON key to match and store every other key for a zerolog event\n\tFieldsKey = \"fields\"\n)\n\n// Log is the basic structure of the events that are sent to the client.\ntype Log struct {\n\tTime    string                 `json:\"time,omitempty\"`","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/management/events.go#L166-L202","documentation":"Returned by LogLevel.UnmarshalJSON when the JSON value is a string but ParseLogLevel does not recognize it (not one of debug/info/warn/error). The payload is well-formed JSON but carries an unsupported level string, e.g. from a newer or misconfigured peer.","triggerScenarios":"Thrown at management/events.go:184 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the exact level string in the incoming management event payload.","Only debug, info, warn, and error are accepted by ParseLogLevel.","Update cloudflared if the peer uses a level added in a newer protocol version."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}