We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.NET 8 <PackageVersion Include="Serilog" Version="4.0.1" /> <PackageVersion Include="Serilog.AspNetCore" Version="8.0.2" /> <PackageVersion Include="Serilog.Expressions" Version="5.0.0" /> <PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" /> <PackageVersion Include="Serilog.Sinks.File" Version="6.0.0" />
{ "Serilog": { "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ], "MinimumLevel": { "Default": "Information", "Override": { "Microsoft.AspNetCore.Mvc": "Warning", "Microsoft.AspNetCore.Routing": "Warning", "Microsoft.AspNetCore.Hosting": "Warning" } }, "WriteTo": [ { "Name": "Console" }, { "Name": "File", "Args": { "path": "Logs/log-.txt", "rollingInterval": "Day", "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}", "fileSizeLimitBytes": 10485760, "rollOnFileSizeLimit": true, "shared": true, "flushToDiskInterval": 1 }, "Filter": [ { "Name": "ByIncluding", "Args": { "expression": "StartsWith(SourceContext, 'Microsoft.EntityFrameworkCore.Database')" } } ] } ], "Enrich": [ "FromLogContext" ] }, "AllowedHosts": "*" }
//Program.cs file builder.Host.UseSerilog((context, config) => config.ReadFrom.Configuration(context.Configuration));
I want to store EF Core related query only in Log file, I will have another file for other type of logging.
I tried using Expression but didn't worked. What I am doing wrong?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to store EF Core related query only in Log file, I will have another file for other type of logging.
I tried using Expression but didn't worked. What I am doing wrong?
The text was updated successfully, but these errors were encountered: