We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm using Serilog.Extensions.Logging.File nuget package Version=2.0.0 in my AspNet Core 3.1 app. This is what I have in my Program.cs file:
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureLogging((hostingContext, builder) => { builder.AddFile(hostingContext.Configuration.GetSection("Serilog")); builder.AddSerilog(dispose: true); })
This is what I have in my appsettings.json
"Serilog": { "Using": [ "Serilog.Sinks.RollingFile" ], "Enrich": [ "FromLogContext" ], "PathFormat": "Logs/myapp-{Date}.txt", "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" }, "Json": false, "FileSizeLimitBytes": 1000000, "RetainedFileCountLimit": 3, "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {Message}{NewLine}Properties: {Properties}{NewLine}MachineName: {MachineName}{NewLine}Application: {Application}{NewLine}{Exception}-------------------------------------------------------------------{NewLine}", "Properties": { "Application": "XWRA", "MachineName": "%COMPUTERNAME%" } }
It generates the txt file but not metadata of Application and Machine name. I'm using Windows machine. Am I missing something?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
I'm using Serilog.Extensions.Logging.File nuget package Version=2.0.0 in my AspNet Core 3.1 app.
This is what I have in my Program.cs file:
This is what I have in my appsettings.json
It generates the txt file but not metadata of Application and Machine name.
I'm using Windows machine.
Am I missing something?
The text was updated successfully, but these errors were encountered: