Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--
<!--
~ Copyright 2022 MONAI Consortium
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -51,12 +51,7 @@
<PackageReference Include="Monai.Deploy.Storage" Version="0.2.7" />
<PackageReference Include="Monai.Deploy.Storage.MinIO" Version="0.2.7" />
<PackageReference Include="Polly" Version="7.2.3" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0" />
<PackageReference Include="Serilog.Exceptions" Version="8.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
<PackageReference Include="Serilog.Sinks.Http" Version="8.0.0" />
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="1.5.3" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 0 additions & 19 deletions src/InformaticsGateway/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
using System;
using System.IO;
using System.IO.Abstractions;
using System.Reflection;
using Ardalis.GuardClauses;
using Elastic.CommonSchema.Serilog;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
Expand All @@ -45,9 +43,6 @@
using Monai.Deploy.Messaging.Configuration;
using Monai.Deploy.Storage;
using Monai.Deploy.Storage.Configuration;
using Serilog;
using Serilog.Events;
using Serilog.Exceptions;

namespace Monai.Deploy.InformaticsGateway
{
Expand Down Expand Up @@ -92,20 +87,6 @@ internal static IHostBuilder CreateHostBuilder(string[] args) =>
configureLogging.AddConfiguration(builderContext.Configuration.GetSection("Logging"));
configureLogging.AddFile(o => o.RootPath = AppContext.BaseDirectory);
})
.UseSerilog((context, services, configuration) => configuration
.ReadFrom.Configuration(context.Configuration)
.ReadFrom.Services(services)
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Debug()
.Enrich.FromLogContext()
.Enrich.WithExceptionDetails()
.Enrich.WithProperty("dllversion", Assembly.GetEntryAssembly().GetName().Version)
.Enrich.WithProperty("dllName", Assembly.GetEntryAssembly().GetName().Name)
.WriteTo.File(
path: "logs/MWM-.log",
rollingInterval: RollingInterval.Day,
formatter: new EcsTextFormatter())
.WriteTo.Console())
.ConfigureServices((hostContext, services) =>
{
services.AddOptions<InformaticsGatewayConfiguration>()
Expand Down
37 changes: 15 additions & 22 deletions src/InformaticsGateway/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,29 +81,22 @@
"TimestampFormat": " HH:mm:ss ",
"UseUtcTimestamp": true
}
}
},
"Serilog": {
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "logs/MTM-.log",
"rollingInterval": "Day",
"rollOnFileSizeLimit": true,
"fileSizeLimitBytes": "10485760",
"retainedFileCountLimit": 30,
"formatter": "Serilog.Formatting.Json.JsonFormatter, Serilog"
}
},
{
"Name": "Http",
"Args": {
//"requestUri": "http://192.168.0.62:5000",
"queueLimitBytes": null
},
"File": {
"BasePath": "logs",
"FileEncodingName": "utf-8",
"DateFormat": "yyyyMMdd",
"CounterFormat": "000",
"MaxFileSize": 10485760,
"IncludeScopes": true,
"MaxQueueSize": 100,
"TextBuilderType": "Monai.Deploy.InformaticsGateway.Logging.FileLoggingTextFormatter, Monai.Deploy.InformaticsGateway",
"Files": [
{
"Path": "MIG-<date>-<counter>.log"
}
}
]
]
}
},
"Kestrel": {
"EndPoints": {
Expand Down