File tree Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Expand file tree Collapse file tree 1 file changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -192,23 +192,19 @@ public async Task<ActionResult<DxLoadResult>> DxQuery([FromQuery] DataSourceLoad
192192
193193# Serilog
194194``` csharp
195- webBuilder .UseSerilog ((c , log ) =>
196- {
197- var arango = c .Configuration .GetConnectionString (" Arango" );
198-
199- log .MinimumLevel .Debug ()
200- .MinimumLevel .Override (" Microsoft" , LogEventLevel .Warning )
201- .MinimumLevel .Override (" Microsoft.Hosting.Lifetime" , LogEventLevel .Information )
202- .Enrich .FromLogContext ()
203- .WriteTo .Sink (new ArangoSerilogSink (new ArangoContext (arango ),
204- database : " logs" ,
205- collection : " logs" ,
206- batchPostingLimit : 50 ,
207- TimeSpan .FromSeconds (2 )),
208- restrictedToMinimumLevel : LogEventLevel .Information );
209-
210- // This is unreliable...
211- if (Environment .UserInteractive )
195+ builder .Host .UseSerilog (
196+ (c , log ) =>
197+ {
198+ var arango = builder .Configuration .GetConnectionString (" Arango" );
199+
200+ log .Enrich .FromLogContext ();
212201 log .WriteTo .Console (theme : AnsiConsoleTheme .Code );
213- });
202+ log .WriteTo .Sink (new PeriodicBatchingSink (new ArangoSerilogSink (new ArangoContext (arango )), new PeriodicBatchingSinkOptions
203+ {
204+ BatchSizeLimit = 1000 ,
205+ QueueLimit = 100000 ,
206+ Period = TimeSpan .FromSeconds (2 ),
207+ EagerlyEmitFirstEvent = true
208+ }));
209+ });
214210```
You can’t perform that action at this time.
0 commit comments