fix(auth): otel export logging

This commit is contained in:
Timothy Schenk 2024-09-16 21:36:50 +02:00
parent 50caf0464b
commit 66ca9c6fa9
Signed by: rainote
SSH key fingerprint: SHA256:pnkNSDwpAnaip00xaZlVFHKKsS7T8UtOomMzvs0yITE
2 changed files with 9 additions and 10 deletions

View file

@ -40,17 +40,15 @@ var loggerFactory = LoggerFactory.Create(loggingBuilder =>
loggingBuilder.AddFile("logs/Continuity.AuthServer-{Date}.log", LogLevel.Trace); loggingBuilder.AddFile("logs/Continuity.AuthServer-{Date}.log", LogLevel.Trace);
loggingBuilder.AddFile("logs/Continuity.AuthServer-{Date}.json.log", LogLevel.Trace, isJson: true); loggingBuilder.AddFile("logs/Continuity.AuthServer-{Date}.json.log", LogLevel.Trace, isJson: true);
loggingBuilder.AddConsole(); loggingBuilder.AddConsole();
loggingBuilder.AddOpenTelemetry(); loggingBuilder.AddOpenTelemetry(logging =>
{
logging.AddOtlpExporter();
logging.IncludeFormattedMessage = true;
logging.IncludeScopes = true;
});
}); });
var configuration = builder.Configuration; var configuration = builder.Configuration;
builder.Logging.AddOpenTelemetry(logging =>
{
logging.IncludeFormattedMessage = true;
logging.IncludeScopes = true;
});
builder.Services.AddOpenTelemetry() builder.Services.AddOpenTelemetry()
.WithMetrics(metrics => .WithMetrics(metrics =>
{ {

View file

@ -34,7 +34,7 @@ services:
db: db:
container_name: continuity-db container_name: continuity-db
image: postgres:16.1-alpine image: postgres:16.4-alpine
restart: always restart: always
environment: environment:
- POSTGRES_USER=continuity - POSTGRES_USER=continuity
@ -52,12 +52,13 @@ services:
mem_limit: 1024m mem_limit: 1024m
aspire: aspire:
image: mcr.microsoft.com/dotnet/aspire-dashboard:8.0.0 image: mcr.microsoft.com/dotnet/aspire-dashboard:8.1
networks: networks:
- continuity - continuity
environment: environment:
- DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS=true - DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS=true
- Dashboard:Frontend:AuthMode=Unsecured - Dashboard:Frontend:AuthMode=Unsecured
- ASPIRE_ALLOW_UNSECURED_TRANSPORT=true
ports: ports:
- 18888:18888 - 18888:18888