<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2018 Scytl Secure Electronic Voting SA

    All rights reserved

    See our extended copyright notice in *file 'Copyright.txt' which is part of this source code package

-->
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

	<appender name="console" class="org.apache.log4j.ConsoleAppender">
		<layout class="com.scytl.products.oscore.logging.core.layout.EscapingPatternLayout">
			<param name="ConversionPattern" value="%d{ISO8601} %-5p %c{1}:%L - %m%n" />
		</layout>
	</appender>

	<appender name="regularAppender" class="org.apache.log4j.RollingFileAppender">
		<param name="maxBackupIndex" value="10" />
		<param name="file" value="${user.home}/sdmServices/logs/develop.log" />
		<layout class="com.scytl.products.oscore.logging.core.layout.EscapingPatternLayout">
			<param name="ConversionPattern" value="%d{ISO8601}|%p|%t|%m%n" />
		</layout>
	</appender>
    
	<!--Execution time metrics
 	<logger name="com.scytl.products.ov.logging.ExecutionTimeLogger"  additivity="false">
	    <level value="TRACE" />
	    <appender-ref ref="timingAppender" />
	</logger>
	
	<appender name="timingAppender" class="org.apache.log4j.RollingFileAppender">
        <param name="maxBackupIndex" value="20" />
        <param name="file" value="${user.home}/sdmServices/logs/mixing-timing.log"/>
        <layout class="org.apache.log4j.EscapingPatternLayout">
            <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss,SSS}|%p|%t|%m%n" />
        </layout>
    </appender>-->

     <!-- with keystore in config -->
     <appender name="secure-appender" class="com.scytl.slogger.SecureAppender">
         <errorHandler class="com.scytl.slogger.SecureErrorHandler">
             <appender-ref ref="SecureErrorFile"/>
         </errorHandler>
        <param name="file" value="${user.home}/sdmServices/logs/mixing_secure.log" />
        <param name="pattern" value="%d{ISO8601}|%p|%t|%m%n" />
        <param name="verifyPattern" value="TIMESTAMP|LEVEL|THREAD|MESSAGE" />
        <param name="numberLogLines" value="10000" />
        <param name="timerLogMilliseconds" value="0" />
        <param name="triggeringTime" value="3600000" />
        <param name="encoding" value="UTF-8" />
        <param name="logFileNamePolicyName" value="SEQUENTIAL_DATE_FILENAME" />
    </appender>

    <appender name="SecureErrorFile" class="org.apache.log4j.RollingFileAppender">
        <param name="file" value="${user.home}/sdmServices/logs/mixing_secure_logger_error.log"/>
        <layout class="com.scytl.products.oscore.logging.core.layout.EscapingPatternLayout">
            <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss,SSS}|%p|%t|%m%n" />
        </layout>
    </appender>

    <logger name="std">
        <level value="INFO" />
        <appender-ref ref="regularAppender" />
    </logger>
    
    <!--Secure logger -->
    <logger name="SecureLogger" additivity="false">
        <level value="INFO" />
        <appender-ref ref="secure-appender" />
    </logger>

    <root>
        <level value="INFO" />
        <appender-ref ref="console" />
    </root>

</log4j:configuration>
