<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <conversionRule conversionWord="morningstarLevel" class="com.eu.habbo.util.logback.ConsoleLevelConverter" />
    <conversionRule conversionWord="morningstarLogger" class="com.eu.habbo.util.logback.ConsoleLoggerConverter" />

    <appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} %morningstarLevel [%-12thread] %morningstarLogger | %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="FileDebug" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>logging/debug.txt</file>
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>DEBUG</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>logging/debug.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
            <maxFileSize>50MB</maxFileSize>
            <maxHistory>7</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %level %logger - %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="FileErrors" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>logging/errors/runtime.txt</file>
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>ERROR</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>logging/errors/runtime.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
            <maxFileSize>50MB</maxFileSize>
            <maxHistory>7</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %level %logger - %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="FileErrorsSql" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>logging/errors/sql.txt</file>
        <filter class="com.eu.habbo.util.logback.SqlExceptionFilter" />
        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>logging/errors/sql.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
            <maxFileSize>50MB</maxFileSize>
            <maxHistory>7</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %level %logger - %msg%n</pattern>
        </encoder>
    </appender>

    <logger name="io.netty" level="INFO"/>

    <logger name="com.zaxxer.hikari" level="ERROR"/>
	
	<logger name="org.mariadb.jdbc" level="WARN"/>

    <root level="INFO">
        <appender-ref ref="Console" />
        <appender-ref ref="FileDebug" />
        <appender-ref ref="FileErrors" />
        <appender-ref ref="FileErrorsSql" />
    </root>
</configuration>
