Skip to content

Release 1.0.2 with double quotes support

Compare
Choose a tag to compare
@eiximenis eiximenis released this 27 May 14:15
· 6 commits to main since this release

Adds support for double quotes management.

                .UseSerilog((hostBuilderContext, config) =>
                {
                    config.MinimumLevel.Verbose()
                    .Enrich.FromLogContext()
                    // .WriteTo.Console()
                    .WriteTo.Console(formatter: new LogfmtFormatter(opt => opt.OnDoubleQuotes(q => q.Escape())));
                })

If a double quote is found inside a message (that is also surrounded by double quotes) you can choose what to do:

  1. Do nothing (this could lead to invalid messages) q.Preserve()
  2. Change inner double quotes by single quotes. This is the default q.ConvertToSingle()
  3. Escape inner double quotes by using \" q.Escape()
  4. Remove inner double quotes q.Remove()