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
When I use the Serilog extensions then my positional format parameters are incorrectly formatted.
The following example:
` class Program {
public static void Main(string[] args) { var builder = Host.CreateDefaultBuilder(args); builder .ConfigureServices((context, services) => { services.AddHostedService<Test>(); }) .UseSerilog((hostingContext, loggerConfiguration) => loggerConfiguration .MinimumLevel.Information() .WriteTo.Console()) .UseConsoleLifetime() .Build().Run(); } class Test : IHostedService { private readonly ILogger<Test> _logger; public Test(ILogger<Test> logger) { _logger = logger; } public Task StartAsync(CancellationToken cancellationToken) { Console.WriteLine(".NET Core string.Format {1}/{0}", "second", "first"); _logger.LogInformation("SeriLogExtensions {1}/{0}", "second", "first"); return Task.CompletedTask; } public Task StopAsync(CancellationToken cancellationToken) { return Task.CompletedTask; } } }`
Note that the format string does not have the positional parameters in the same order as the arguments.
The .NET Console writeline will print first/second, but when using the serilog extensions I have the reverse.
Expected: .NET Core string.Format first/second [15:30:57 INF] SeriLogExtensions first/second
Actual: .NET Core string.Format first/second [15:30:57 INF] SeriLogExtensions second/first
The text was updated successfully, but these errors were encountered:
Sorry, ignore my comment! Just realized you're already doing that; I'll move this issue over to that repository.
Sorry, something went wrong.
No branches or pull requests
When I use the Serilog extensions then my positional format parameters are incorrectly formatted.
The following example:
` class Program
{
Note that the format string does not have the positional parameters in the same order as the arguments.
The .NET Console writeline will print first/second, but when using the serilog extensions I have the reverse.
Expected:
.NET Core string.Format first/second
[15:30:57 INF] SeriLogExtensions first/second
Actual:
.NET Core string.Format first/second
[15:30:57 INF] SeriLogExtensions second/first
The text was updated successfully, but these errors were encountered: