<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn" monitorInterval="30">
	<CustomLevels>
		<CustomLevel name="AUDIT" intLevel="560" />
	</CustomLevels>
    <Appenders>
		<RollingFile name="IPSRollingFile" 
				fileName="${log4j:configParentLocation}/../../logs/ips-presenceserver.log"
				filePattern="${log4j:configParentLocation}/../../oldlogs/$${date:yyyy-MM}/ips-presenceserver-%d{MM-dd-yyyy}-%i.log.gz">
			<PatternLayout>
				<Pattern>%d %-5p %t %C{1}:%M %x - %m%n</Pattern>
			</PatternLayout>
			<Policies>
				<TimeBasedTriggeringPolicy />
				<SizeBasedTriggeringPolicy size="300MB"/>
			</Policies>
		</RollingFile>
		
		<RollingFile name="IPSAUDIT_RollingFile" 
				fileName="${log4j:configParentLocation}/../../logs/ips-audit.log"
				filePattern="${log4j:configParentLocation}/../../oldlogs/$${date:yyyy-MM}/ips-audit-%d{MM-dd-yyyy}-%i.log.gz">
				<LevelRangeFilter minLevel="AUDIT" maxLevel="AUDIT" onMatch="ACCEPT" onMismatch="DENY"/>
			<PatternLayout>
				<Pattern>%m %x%n</Pattern>
			</PatternLayout>
			<Policies>
				<TimeBasedTriggeringPolicy />
				<SizeBasedTriggeringPolicy size="300MB"/>
			</Policies>
		</RollingFile>
    </Appenders>
	
    <Loggers>			
        <!-- avoid duplicated logs with additivity=false --> 
		<logger name="com.ev.assistedge.retem.distributed.threads" level="OFF" additivity="false">
			<AppenderRef ref="IPSRollingFile"/>
		</logger>	
		<logger name="org.hibernate" additivity="false">
			<AppenderRef ref="IPSRollingFile" level="error"/>
		</logger>
        <Root level="trace" additivity="false">
            <AppenderRef ref="IPSRollingFile" level="info"/>
			<AppenderRef ref="IPSAUDIT_RollingFile" level="AUDIT"/>
        </Root>
    </Loggers>
</Configuration>
