-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
I have deployed an application developed in .Net 6 to Cloud Run. Although I have set UseLogCorrelation to True, the Trace is not being displayed in the output logs. Is there a mistake in my configuration?
Program.cs
var builder = WebApplication.CreateBuilder(args);
var config = new GoogleCloudLoggingSinkOptions { ProjectId = "MY_PROJECT_ID", UseLogCorrelation = true };
builder.Host.UseSerilog((ctx, lc) => lc
.ReadFrom.Configuration(ctx.Configuration)
.Enrich.FromLogContext()
.WriteTo.GoogleCloudLogging(config));
Controller
Log.Information("Test Log");
_logger.LogInformation("Test Log")
Log
{
"insertId": "6dzqzcg106aqd8",
"jsonPayload": {
"properties": {
"ActionId": "5dfa3659-b6c6-4a30-a1e2-6ae582176be1",
"RequestPath": "/Api",
"SourceContext": "WebAPI.Controllers.ApiController",
"RequestId": "0HN10GKCPK726:00000002",
"ActionName": "WebAPI.Controllers.ApiController.Get (WebAPI)",
"ConnectionId": "0HN10GKCPK726"
},
"message": "Test Log"
},
"resource": {
"type": "cloud_run_revision",
"labels": {
"location": "asia-east2",
"configuration_name": "logtest",
"service_name": "logtest",
"project_id": "MY_PROJECT_ID",
"revision_name": "myproject-00029-p9s"
}
},
"timestamp": "2024-01-29T04:45:22.692149600Z",
"severity": "INFO",
"logName": "projects/MY_PROJECT_ID/logs/WebAPI.Controllers.ApiController",
"receiveTimestamp": "2024-01-29T04:45:33.794937066Z"
}
Metadata
Metadata
Assignees
Labels
No labels