Is it possible to combine structured logging with string interpolation in C#?

330 views Asked by At

I would like to do this:

logger.LogInformation($"Calling {nameof(MyMethod)} for message {messageId}", messageId);

So far it seems not possible to combine syntax for structured logging with interpolated string. Maybe I am missing something here and there is syntax for that?

P.S. I want the first argument interpolated, but the latter be used in structured logging.

0

There are 0 answers