Serilog does not produce expected json Serilog does not produce expected json json json

Serilog does not produce expected json


By default, Serilog will ToString() any unknown types passed into message templates.

To activate what Serilog calls "destructuring" (i.e. serialization) you need to prepend an at-sign @ to the property name:

logger.Debug("This is the new type {@NewType} generated at {Time}", newType, DateTime.Now);