Skip to content

Commit 317860e

Browse files
committed
[增加]1. 增加app 和app_name 的默认配置
1 parent 42dad42 commit 317860e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

GameFrameX.Foundation.Logger/LogHandler.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public static ILogger Create(LogOptions logOptions, bool isDefault = true, Actio
6363
.Enrich.FromLogContext()
6464
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
6565
.MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning)
66+
.Enrich.WithProperty("app", logOptions.LogType ?? AppDomain.CurrentDomain.FriendlyName)
67+
.Enrich.WithProperty("app_name", logOptions.LogType ?? AppDomain.CurrentDomain.FriendlyName)
6668
.WriteTo.File(logPath, rollingInterval: logOptions.RollingInterval, rollOnFileSizeLimit: logOptions.IsFileSizeLimit, fileSizeLimitBytes: logOptions.FileSizeLimitBytes, retainedFileCountLimit: logOptions.RetainedFileCountLimit);
6769
if (logOptions.IsGrafanaLoki)
6870
{

0 commit comments

Comments
 (0)