> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::set_log_pattern

> Set global log format string.

```cpp showLineNumbers={false}
void holoscan::set_log_pattern(
    std::string pattern = ""
)
```

Set global log format string.

If the environment variable `HOLOSCAN_LOG_FORMAT` is set, the log pattern will be overridden by the value of the environment variable.

If the user has not set the log pattern explicitly before Application::Application() is called and no environment variable (HOLOSCAN\_LOG\_FORMAT) is set, the default log pattern will be used.

`HOLOSCAN_LOG_FORMAT` can be set to one of the following values:

* SHORT: prints message severity level, and message
* DEFAULT: prints message severity level, filename:linenumber, and message
* LONG: prints timestamp, application, message severity level, filename:linenumber, and message
* FULL: prints timestamp, thread id, application, message severity level, filename:linenumber, and message

Or, a custom format string can be specified. Please refer to the [spdlog documentation](https://spdlog.docsforge.com/v1.x/3.custom-formatting/#customizing-format-using-set_pattern) for the format string syntax.

**Parameters**

**`pattern`** `std::string` — default: ""

The format string.

---