# Message templates

Message template is the text of a log message that can potentially contain placeholders filled with property values during rendering.

Placeholders are always specified in curly brackets: `Response code = {Code}.`

During rendering, placeholders are replaced with values of properties with corresponding names:

`Response code = {Code}` + `{"Code": "200"}` = `Response code = 200`

Any mismatched brackets are kept as-is: `{key}` template renders to the same text.

Any placeholders without corresponding properties are replaced with empty strings.

Double curly brackets can be used to escape occurrences of curly brackets in text: `{{key}}` template renders to `{key}` text.

{% hint style="warning" %}
Do not pass a message as a message template.

For example, instead of `log.Info(json)` you should use `log.Info("{Json}", json)`.

Otherwise, you may have performance issues (due to the internal templates cache) or corrupted messages (due to the rendering stage).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vostok.gitbook.io/logging/concepts/syntax/message-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
