A message template is a log message with named placeholders. Values supplied to the logging call fill those placeholders and are captured as structured properties. Names such as `{StartTime}` make a log call easier to read than numbered placeholders such as `{0}`. section 7.2.5 section 7.4.5
Log a controller start time
_logger.LogInformation(CustomLogEvents.BoardGamesController_Get, "Get method started at {StartTime:HH:mm}.", DateTime.Now); `StartTime` names the value; `HH:mm` formats its displayed time. The event ID remains a separate argument. section 7.4.5
With multiple placeholders, pass values in the same order as the placeholders appear. The names describe the properties; they do not select variables by name. For example, `{catName}` receives `categoryName` because it occupies the corresponding argument position. section 7.2.5
_logger.LogInformation(CustomLogEvents.BoardGamesController_Get,
"Get method started [{MachineName}] [{ThreadId}].", #1
Environment.MachineName, #2
Environment.CurrentManagedThreadId); #3
This controller call pairs `{MachineName}` and `{ThreadId}` with two arguments in order. section 7.4.5
The same pattern works for errors: add an `{errorMessage}` placeholder to an exception-handler log call and supply the exception’s `Message` value. section 7.5.3
