- appsettings.json/Development.json에 Serilog 섹션 추가 (Console/File Sink, Rolling Daily) - RequestIdMiddleware 구현 (X-Request-ID 헤더 발급/반환) - Program.cs에 Serilog 호스트 빌더 + UseSerilogRequestLogging 등록 - 환경별 로그 레벨 분리 (Development: Debug, Production: Warning)
46 lines
1.0 KiB
JSON
46 lines
1.0 KiB
JSON
{
|
|
"AllowedHosts": "*",
|
|
"ConnectionStrings": {
|
|
"DefaultConnection": ""
|
|
},
|
|
"JwtSettings": {
|
|
"SecretKey": "",
|
|
"Issuer": "SPMS",
|
|
"Audience": "SPMS",
|
|
"ExpiryMinutes": 10,
|
|
"RefreshTokenExpiryDays": 7
|
|
},
|
|
"RabbitMQ": {
|
|
"HostName": "",
|
|
"Port": 0,
|
|
"UserName": "",
|
|
"Password": "",
|
|
"VirtualHost": "/"
|
|
},
|
|
"Serilog": {
|
|
"Using": ["Serilog.Sinks.Console", "Serilog.Sinks.File"],
|
|
"MinimumLevel": {
|
|
"Default": "Warning",
|
|
"Override": {
|
|
"SPMS": "Information",
|
|
"Microsoft.AspNetCore": "Warning",
|
|
"Microsoft.EntityFrameworkCore": "Warning"
|
|
}
|
|
},
|
|
"WriteTo": [
|
|
{
|
|
"Name": "File",
|
|
"Args": {
|
|
"path": "Logs/spms-.log",
|
|
"rollingInterval": "Day",
|
|
"retainedFileCountLimit": 30,
|
|
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{RequestId}] {Message:lj}{NewLine}{Exception}"
|
|
}
|
|
}
|
|
],
|
|
"Enrich": ["FromLogContext"],
|
|
"Properties": {
|
|
"Application": "SPMS_API"
|
|
}
|
|
}
|
|
} |