<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Spring-boot Examples
  ~
  ~ Copyright (c) 2021. Elex. All Rights Reserved.
  ~ https://www.elex-project.com/
  -->

<configuration>
	<property name="LOG_FILE" value="LogFile" />
	<property name="LOG_DIR" value="/var/log/application" />

	<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
		<encoder>
			<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
		</encoder>
	</appender>

	<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<file>${LOG_DIR}/${LOG_FILE}.log</file>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<!-- daily rollover -->
			<fileNamePattern>${LOG_DIR}/%d{yyyy/MM}/${LOG_FILE}.gz</fileNamePattern>
			<!-- keep 30 days' worth of history capped at 3GB total size -->
			<maxHistory>30</maxHistory>
			<totalSizeCap>3GB</totalSizeCap>
		</rollingPolicy>
		<encoder>
			<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
		</encoder>
	</appender>

	<root level="TRACE">
		<appender-ref ref="CONSOLE" />
	</root>
</configuration>
