<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<timestamp key="myTimestamp" timeReference="contextBirth"
		datePattern="HH-mm-ss" />
	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
		<layout class="ch.qos.logback.classic.PatternLayout">
			<Pattern>[%p] %d [%.12t] %c \(%M\) - %msg%n</Pattern>
		</layout>
	</appender>
	<root>
		<level value="INFO" />
		<appender-ref ref="STDOUT" />
	</root>
	<if condition='property("openvidu.cdr").contains("true")'>
		<then>
			<appender name="CDR"
				class="ch.qos.logback.core.rolling.RollingFileAppender">
				<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
					<FileNamePattern>log/CDR.%d{yyyy-MM-dd}_${myTimestamp}.log
					</FileNamePattern>
					<MaxHistory>30</MaxHistory>
					<TotalSizeCap>20GB</TotalSizeCap>
				</rollingPolicy>
				<layout>
					<pattern>%m\n</pattern>
				</layout>
			</appender>
			<logger name="io.openvidu.server.cdr.CDRLoggerFile">
				<level value="INFO" />
				<appender-ref ref="CDR" />
			</logger>
		</then>
	</if>
</configuration>