<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
	<Properties>
		<Property name="logPath">${sys:catalina.home}/temp</Property>
	</Properties>
  	<Appenders>
  		<Console name="DefaultConsole">
			<PatternLayout pattern='[%d{yyyy-MM-dd HH:mm:ss}] %-5p %X{FILE}:%X{METHOD}:%X{LINE} - %X{USERNAME} - %X{SOURCE} - %X{EXCEPTION} - %m%n' />
    	</Console>
  		<!-- Hibernate oder ähnliches welches nicht abfangbar ist -->
    	<Console name="ClassesConsole">
    		<Patternlayout pattern='[%d{yyyy-MM-dd HH:mm:ss}] %-5p %t - %m%n' />
    	</Console>
   
    	<RollingFile name="DefaultLog" fileName="${logPath}/WebPortal.log" filePattern="${logPath}/WebPortal-%d{MM-dd-yyyy}.log" append="true">
    		<PatternLayout pattern='[%d{yyyy-MM-dd HH:mm:ss}] %-5p %X{FILE}:%X{METHOD}:%X{LINE} - %X{USERNAME} - %X{SOURCE} - %X{EXCEPTION} - %m%n' />
			<Policies>
			  <TimeBasedTriggeringPolicy interval="1"/>
			  <SizeBasedTriggeringPolicy size="50 MB" />
			</Policies>
    	</RollingFile>
    	
    	<RollingFile name="ClassesLog" fileName="${logPath}/JavaClasses.log" filePattern="${logPath}/JavaClasses-%d{MM-dd-yyyy}.log" append="true">
    		<PatternLayout pattern='[%d{yyyy-MM-dd HH:mm:ss}] %-5p Thread:%t - %m%n' />
			<Policies>
			  <TimeBasedTriggeringPolicy interval="1"/>
			  <SizeBasedTriggeringPolicy size="50 MB" />
			</Policies>
    	</RollingFile>
  	</Appenders>
  	<Loggers>
    	<Root level="INFO">
      		<AppenderRef ref="DefaultConsole" />
			<appender-ref ref="DefaultLog" />
  		</Root>
  		<logger name="org" level="ERROR" additivity="false" includeLocation="false">
  			<appender-ref ref="ClassesConsole" />
			<appender-ref level="INFO" ref="ClassesLog" />
		</logger>
  		<Logger name="de.geis" level="INFO" additivity="false" includeLocation="false">
			<appender-ref ref="DefaultConsole" />
			<appender-ref level="DEBUG" ref="DefaultLog" />
  		</Logger>
  		<Logger name="com.zaxxer.hikari.HikariConfig" level="INFO" additivity="false" includeLocation="false">
			<appender-ref ref="DefaultConsole" />
			<appender-ref level="DEBUG" ref="DefaultLog" />
  		</Logger>
  		<Logger name="de.geis.examples" level="INFO" additivity="false" includeLocation="false">
			<appender-ref ref="DefaultConsole" />
  		</Logger>
  		<Logger name="managedbeans" level="INFO" additivity="false" includeLocation="false">
  			<appender-ref ref="DefaultConsole" />
  			<appender-ref level="DEBUG" ref="DefaultLog" />
  		</Logger>
  	</Loggers>
</Configuration>

<!-- https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html -->