Skip to content
Open
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
25 changes: 11 additions & 14 deletions SysML2.NET.Viewer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ namespace SysML2.NET.Viewer

using Radzen;

using Serilog;
using Serilog.Events;
using Serilog;

using SySML2.NET.REST;
using SysML2.NET.Serializer.Json;
Expand All @@ -55,18 +54,16 @@ public static class Program
/// <returns>
/// an awaitable <see cref="Task"/>
/// </returns>
public static async Task Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.BrowserConsole()
.CreateLogger();

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.Services.AddLogging(loggingBuilder =>
loggingBuilder.AddSerilog(dispose: true));
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);

Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(builder.Configuration)
.CreateLogger();

builder.Services.AddLogging(loggingBuilder =>
loggingBuilder.AddSerilog(dispose: true));

builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
Expand Down
14 changes: 10 additions & 4 deletions SysML2.NET.Viewer/SysML2.NET.Viewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.13" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.13" PrivateAssets="all" />
<PackageReference Include="ReactiveUI" Version="22.3.1" />
<PackageReference Include="Radzen.Blazor" Version="9.0.4" />
<PackageReference Include="Serilog.Extensions.Logging" Version="10.0.0" />
<PackageReference Include="Serilog.Sinks.BrowserConsole" Version="8.0.0" />
</ItemGroup>
<PackageReference Include="Radzen.Blazor" Version="9.0.4" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="3.0.1" />
<PackageReference Include="Serilog.Enrichers.Process" Version="3.0.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="10.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="10.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="2.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
<Folder Include="ViewModels\Pages\" />
Expand Down
37 changes: 37 additions & 0 deletions SysML2.NET.Viewer/wwwroot/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File", "Serilog.Sinks.Async" ],
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Console"
},
{
"Name": "Async",
"Args": {
"configure": [
{
"Name": "File",
"Args": {
"path": "logs/log-reqifviewer-.txt",
"rollingInterval": "Day",
"rollOnFileSizeLimit": true
}
}
]
}
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ],
"Properties": {
"Application": "dmap-cdao",
"Environment": "Production"
}
}
}
Loading