ClickHouse / ClickHouse/Serilog.Sinks.ClickHouse

Clean message template formatting

Open
#26 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3
Forks
3
Avg merge
7d 1h
Merged PRs (30d)
2

Description

Hi! I just spotted your blog post, looks like a nice sink! 👍

One thing - "early" Serilog rendered message templates with double quotes around the placeholders, e.g.:

```
Hello, {Name}!
```

Becomes:

```
Hello, "Claude"!
```

This is still the behavior of `LogEvent.RenderMessage()` for back-compat reasons, but the results are awful and don't usually match what users intuitively search for when working with the logs.

Although not provided by Serilog.npkg directly (text formatting duties now fall to the templating engine in _Serilog.Expressions_), polished, newer code drops the double quotes:

```
Hello, Claude!
```

Here's how _Serilog.Sinks.OpenTelemetry_ does it:

https://github.com/serilog/serilog-sinks-opentelemetry/blob/dev/src/Serilog.Sinks.OpenTelemetry/Sinks/OpenTelemetry/Formatting/CleanMessageTemplateFormatter.cs

HTH,
Nick

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.