Describe the bug
With Amazon.Lambda.Logging.AspNetCore, the ILogger category name is included in log output in plain-text mode (governed by LambdaLoggerOptions.IncludeCategory), but in JSON log format the category is dropped entirely: the JSON branch of LambdaILogger.Log only forwards the message template and arguments, and JsonLogMessageFormatter has no category concept either. IncludeCategory = true is silently ignored.
The category is the primary key for locating and filtering .NET logs ("which class/middleware emitted this?"). After switching a function from text to JSON log format, CloudWatch Logs Insights queries can no longer filter on it, and log lines can only be traced back to their source by searching for the literal message text.
Regression Issue
(Behavioral regression when migrating a function from text to JSON log format: the category was present in every text log line, and there is no way to opt back into it.)
Expected Behavior
The logger category available in JSON records — ideally as a dedicated property, e.g.:
{
"timestamp": "2026-07-04T22:43:57.529Z",
"level": "Information",
"category": "MyApp.Filters.IdentityValidatorActionFilter",
"message": "Successfully authenticated user"
}
Current Behavior
{
"timestamp": "2026-07-04T22:43:57.529Z",
"level": "Information",
"message": "Successfully authenticated user"
}
No trace of the category anywhere in the record, regardless of LambdaLoggerOptions.IncludeCategory.
Reproduction Steps
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAWSLambdaHosting(LambdaEventSource.RestApi);
builder.Logging.ClearProviders();
builder.Logging.AddLambdaLogger();
var app = builder.Build();
app.MapGet("/", (ILogger<Program> logger) =>
{
logger.LogInformation("Hello from a categorized logger");
return "ok";
});
app.Run();
Deploy with LoggingConfig.LogFormat: JSON, invoke /, and observe that the record contains no Program/category information, while the same app with text log format produces info: Program[0] Hello from a categorized logger.
Possible Solution
Emit the category as a top-level JSON property ("category"), or at minimum honor IncludeCategory by prefixing the rendered message.
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
Amazon.Lambda.AspNetCoreServer 10.1.1
Amazon.Lambda.AspNetCoreServer.Hosting 2.1.0
Amazon.Lambda.Logging.AspNetCore 5.0.0
Amazon.Lambda.Core 3.1.0
Targeted .NET Platform
.NET 10 (managed dotnet10 runtime)
Operating System and version
Amazon Linux 2023 (Lambda managed runtime)
Describe the bug
With
Amazon.Lambda.Logging.AspNetCore, theILoggercategory name is included in log output in plain-text mode (governed byLambdaLoggerOptions.IncludeCategory), but in JSON log format the category is dropped entirely: the JSON branch ofLambdaILogger.Logonly forwards the message template and arguments, andJsonLogMessageFormatterhas no category concept either.IncludeCategory = trueis silently ignored.The category is the primary key for locating and filtering .NET logs ("which class/middleware emitted this?"). After switching a function from text to JSON log format, CloudWatch Logs Insights queries can no longer filter on it, and log lines can only be traced back to their source by searching for the literal message text.
Regression Issue
(Behavioral regression when migrating a function from text to JSON log format: the category was present in every text log line, and there is no way to opt back into it.)
Expected Behavior
The logger category available in JSON records — ideally as a dedicated property, e.g.:
{ "timestamp": "2026-07-04T22:43:57.529Z", "level": "Information", "category": "MyApp.Filters.IdentityValidatorActionFilter", "message": "Successfully authenticated user" }Current Behavior
{ "timestamp": "2026-07-04T22:43:57.529Z", "level": "Information", "message": "Successfully authenticated user" }No trace of the category anywhere in the record, regardless of
LambdaLoggerOptions.IncludeCategory.Reproduction Steps
Deploy with
LoggingConfig.LogFormat: JSON, invoke/, and observe that the record contains noProgram/category information, while the same app with text log format producesinfo: Program[0] Hello from a categorized logger.Possible Solution
Emit the category as a top-level JSON property (
"category"), or at minimum honorIncludeCategoryby prefixing the rendered message.Additional Information/Context
No response
AWS .NET SDK and/or Package version used
Amazon.Lambda.AspNetCoreServer 10.1.1
Amazon.Lambda.AspNetCoreServer.Hosting 2.1.0
Amazon.Lambda.Logging.AspNetCore 5.0.0
Amazon.Lambda.Core 3.1.0
Targeted .NET Platform
.NET 10 (managed
dotnet10runtime)Operating System and version
Amazon Linux 2023 (Lambda managed runtime)