Skip to content

Commit f77e666

Browse files
authored
Revert "rebased changes (#170)" (#177)
This reverts commit 148c1e4.
1 parent 34974f1 commit f77e666

File tree

3 files changed

+16
-47
lines changed

3 files changed

+16
-47
lines changed

src/InformaticsGateway/Monai.Deploy.InformaticsGateway.csproj

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--
1+
<!--
22
~ Copyright 2022 MONAI Consortium
33
~
44
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -51,12 +51,7 @@
5151
<PackageReference Include="Monai.Deploy.Storage" Version="0.2.7" />
5252
<PackageReference Include="Monai.Deploy.Storage.MinIO" Version="0.2.7" />
5353
<PackageReference Include="Polly" Version="7.2.3" />
54-
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0" />
55-
<PackageReference Include="Serilog.Exceptions" Version="8.4.0" />
5654
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
57-
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
58-
<PackageReference Include="Serilog.Sinks.Http" Version="8.0.0" />
59-
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="1.5.3" />
6055
</ItemGroup>
6156

6257
<ItemGroup>

src/InformaticsGateway/Program.cs

-19
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
using System;
1818
using System.IO;
1919
using System.IO.Abstractions;
20-
using System.Reflection;
2120
using Ardalis.GuardClauses;
22-
using Elastic.CommonSchema.Serilog;
2321
using Microsoft.AspNetCore.Hosting;
2422
using Microsoft.EntityFrameworkCore;
2523
using Microsoft.Extensions.Configuration;
@@ -45,9 +43,6 @@
4543
using Monai.Deploy.Messaging.Configuration;
4644
using Monai.Deploy.Storage;
4745
using Monai.Deploy.Storage.Configuration;
48-
using Serilog;
49-
using Serilog.Events;
50-
using Serilog.Exceptions;
5146

5247
namespace Monai.Deploy.InformaticsGateway
5348
{
@@ -92,20 +87,6 @@ internal static IHostBuilder CreateHostBuilder(string[] args) =>
9287
configureLogging.AddConfiguration(builderContext.Configuration.GetSection("Logging"));
9388
configureLogging.AddFile(o => o.RootPath = AppContext.BaseDirectory);
9489
})
95-
.UseSerilog((context, services, configuration) => configuration
96-
.ReadFrom.Configuration(context.Configuration)
97-
.ReadFrom.Services(services)
98-
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
99-
.MinimumLevel.Debug()
100-
.Enrich.FromLogContext()
101-
.Enrich.WithExceptionDetails()
102-
.Enrich.WithProperty("dllversion", Assembly.GetEntryAssembly().GetName().Version)
103-
.Enrich.WithProperty("dllName", Assembly.GetEntryAssembly().GetName().Name)
104-
.WriteTo.File(
105-
path: "logs/MWM-.log",
106-
rollingInterval: RollingInterval.Day,
107-
formatter: new EcsTextFormatter())
108-
.WriteTo.Console())
10990
.ConfigureServices((hostContext, services) =>
11091
{
11192
services.AddOptions<InformaticsGatewayConfiguration>()

src/InformaticsGateway/appsettings.json

+15-22
Original file line numberDiff line numberDiff line change
@@ -81,29 +81,22 @@
8181
"TimestampFormat": " HH:mm:ss ",
8282
"UseUtcTimestamp": true
8383
}
84-
}
85-
},
86-
"Serilog": {
87-
"WriteTo": [
88-
{
89-
"Name": "File",
90-
"Args": {
91-
"path": "logs/MTM-.log",
92-
"rollingInterval": "Day",
93-
"rollOnFileSizeLimit": true,
94-
"fileSizeLimitBytes": "10485760",
95-
"retainedFileCountLimit": 30,
96-
"formatter": "Serilog.Formatting.Json.JsonFormatter, Serilog"
97-
}
98-
},
99-
{
100-
"Name": "Http",
101-
"Args": {
102-
//"requestUri": "http://192.168.0.62:5000",
103-
"queueLimitBytes": null
84+
},
85+
"File": {
86+
"BasePath": "logs",
87+
"FileEncodingName": "utf-8",
88+
"DateFormat": "yyyyMMdd",
89+
"CounterFormat": "000",
90+
"MaxFileSize": 10485760,
91+
"IncludeScopes": true,
92+
"MaxQueueSize": 100,
93+
"TextBuilderType": "Monai.Deploy.InformaticsGateway.Logging.FileLoggingTextFormatter, Monai.Deploy.InformaticsGateway",
94+
"Files": [
95+
{
96+
"Path": "MIG-<date>-<counter>.log"
10497
}
105-
}
106-
]
98+
]
99+
}
107100
},
108101
"Kestrel": {
109102
"EndPoints": {

0 commit comments

Comments
 (0)