{"record":{"id":"d160b9317b389bb7","repo":"dotnet/aspnetcore","slug":"unknown-log-level-name","errorCode":null,"errorMessage":"Unknown log level: ${name}","messagePattern":"Unknown log level: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/SignalR/clients/ts/signalr/src/HubConnectionBuilder.ts","lineNumber":38,"sourceCode":"    debug: LogLevel.Debug,\n    info: LogLevel.Information,\n    information: LogLevel.Information,\n    warn: LogLevel.Warning,\n    warning: LogLevel.Warning,\n    error: LogLevel.Error,\n    critical: LogLevel.Critical,\n    none: LogLevel.None,\n};\n\nfunction parseLogLevel(name: string): LogLevel {\n    // Case-insensitive matching via lower-casing\n    // Yes, I know case-folding is a complicated problem in Unicode, but we only support\n    // the ASCII strings defined in LogLevelNameMapping anyway, so it's fine -anurse.\n    const mapping = LogLevelNameMapping[name.toLowerCase()];\n    if (typeof mapping !== \"undefined\") {\n        return mapping;\n    } else {\n        throw new Error(`Unknown log level: ${name}`);\n    }\n}\n\n/** A builder for configuring {@link @microsoft/signalr.HubConnection} instances. */\nexport class HubConnectionBuilder {\n    private _serverTimeoutInMilliseconds?: number;\n    private _keepAliveIntervalInMilliseconds ?: number;\n\n    /** @internal */\n    public protocol?: IHubProtocol;\n    /** @internal */\n    public httpConnectionOptions?: IHttpConnectionOptions;\n    /** @internal */\n    public url?: string;\n    /** @internal */\n    public logger?: ILogger;\n\n    /** If defined, this indicates the client should automatically attempt to reconnect if the connection is lost. */","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/dotnet/aspnetcore/blob/3600ca084e9c8b5f4174fc5e747f4c52d2100806/src/SignalR/clients/ts/signalr/src/HubConnectionBuilder.ts#L20-L56","documentation":"Thrown by parseLogLevel in HubConnectionBuilder when the string passed to `configureLogging` does not case-insensitively match any key in LogLevelNameMapping (trace/debug/information/warning/error/critical/none). The builder accepts either a LogLevel enum value or one of these canonical strings; an unrecognized string is rejected.","triggerScenarios":"Calling `.configureLogging(\"warn\")`, `\"info\"`, `\"verbose\"`, `\"DEBUG\"` (only the canonical names are mapped — though lower-casing handles case, the canonical name set is fixed), or any typo of a supported level.","commonSituations":"Developers used to other loggers (winston, pino, log4j) passing `warn`/`info`/`fatal`, or passing a numeric-string like `\"1\"`.","solutions":["Use one of: trace, debug, information, warning, error, critical, none (case-insensitive).","Prefer the LogLevel enum constant (`LogLevel.Information`) to avoid typos.","If loading the level from config, validate against the allowed set."],"exampleFix":"// before\n.configureLogging(\"info\")\n// after\n.configureLogging(\"information\")\n// or\nimport { LogLevel } from \"@microsoft/signalr\";\n.configureLogging(LogLevel.Information)","handlingStrategy":"validation","validationCode":"import { LogLevel } from \"@microsoft/signalr\";\nconst ALLOWED = [\"trace\",\"debug\",\"information\",\"warning\",\"error\",\"critical\",\"none\"];\nfunction parseSafe(name: string): LogLevel | undefined {\n  const n = name.toLowerCase();\n  return ALLOWED.includes(n) ? (LogLevel as any)[n[0].toUpperCase()+n.slice(1)] : undefined;\n}","typeGuard":"function isLogLevelName(name: string): boolean {\n  return [\"trace\",\"debug\",\"information\",\"warning\",\"error\",\"critical\",\"none\"].includes(name.toLowerCase());\n}","tryCatchPattern":null,"preventionTips":["Prefer LogLevel enum constants over strings.","Validate config strings against the allowed set.","Remember the canonical name is 'information', not 'info'."],"tags":["logging","configuration","validation"],"backgroundTag":null,"analyzedSha":"3600ca084e9c8b5f4174fc5e747f4c52d2100806","analyzedAt":"2026-08-11T16:32:30.678Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}