> For the complete documentation index, see [llms.txt](https://docs.b2ihealthcare.com/snow-owl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.b2ihealthcare.com/snow-owl/setup-and-administration/advanced-configuration/logging.md).

# Logging configuration

Snow Owl uses [SLF4J](https://www.slf4j.org/) and [Logback](https://logback.qos.ch/) for logging.

The logging configuration file (`serviceability.xml`) can be used to configure Snow Owl logging. The logging configuration file location depends on your installation method, by default it is located in the `${SO_HOME}/configuration` folder.

Extensive information on how to customize logging and all the supported appenders can be found on the [Logback documentation](https://logback.qos.ch/manual/configuration.html).

### Logstash encoding

Snow Owl supports the generation of structured application logs via the [Logstash encoder](https://github.com/logfellow/logstash-logback-encoder/).

To enable it uncomment the example snippet provided in the console appender section in the `configuration/serviceability.xml` file or copy and paste it from here:

```xml
...
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
            <providers>
                <timestamp>
                    <fieldName>timestamp</fieldName>
                    <timeZone>UTC</timeZone>
                </timestamp>
                <loggerName>
                    <fieldName>logger</fieldName>
                </loggerName>
                <logLevel>
                    <fieldName>level</fieldName>
                </logLevel>
                <threadName>
                    <fieldName>thread</fieldName>
                </threadName>
                <nestedField>
                    <fieldName>mdc</fieldName>
                    <providers>
                        <mdc />
                    </providers>
                </nestedField>
                <stackTrace>
                    <fieldName>stackTrace</fieldName>
                    <throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
                        <maxDepthPerThrowable>200</maxDepthPerThrowable>
                        <maxLength>14000</maxLength>
                        <rootCauseFirst>true</rootCauseFirst>
                    </throwableConverter>
                </stackTrace>
                <message />
                <throwableClassName>
                    <fieldName>exceptionClass</fieldName>
                </throwableClassName>
            </providers>
	</encoder>
</appender>
...
```

For additional config options visit the Logstash encoder GitHub page or [this site](https://learn.microsoft.com/en-us/azure/spring-apps/basic-standard/structured-app-log#log-with-logback).
