瀏覽代碼

注释日志

Dun.Jason 4 天之前
父節點
當前提交
574ba9c9b6
共有 1 個文件被更改,包括 5 次插入13 次删除
  1. 5 13
      src/Hotline.Api/Program.cs

+ 5 - 13
src/Hotline.Api/Program.cs

@@ -1,6 +1,5 @@
 using Hotline.Api;
 using Serilog;
-using Serilog.Formatting.Display;
 using XF.Domain.Authentications;
 
 Log.Logger = new LoggerConfiguration()
@@ -35,19 +34,12 @@ try
                 .AddCommandLine(args)
                 ;
         })
-        //.UseSerilog((ctx, lc) => lc
-        ////.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}")
-        //.Enrich.FromLogContext()
-        //.ReadFrom.Configuration(ctx.Configuration), true)
-        ;
-    
-    builder.Services.AddSerilog((services, lc) => lc
-        .ReadFrom.Configuration(builder.Configuration)
-        .ReadFrom.Services(services)
+        .UseSerilog((ctx, lc) => lc
+        //.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}")
         .Enrich.FromLogContext()
-    );
-
-
+        .ReadFrom.Configuration(ctx.Configuration), true)
+        ;
+    //builder.Services.AddControllers().AddNewtonsoftJson();
     builder
         .ConfigureServices()
         .ConfigurePipelines()