Hi All,

I have below log42 xml in classes folder and I am on log4j2 . This setting
does not log exception and it just logs1 line exception.

How do I make log4j2 to log complete exception trace in mysite log ?



<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<configuration>
    <Properties>
         <Property name="log-path">C:/logs/</Property>
<!--       <Property name="log-path">/home/mydrive/logs/</Property>-->
    </Properties>
    <Appenders>
        <RollingFile name="RollingFile" fileName="${log-path}/mysite.log"

 filePattern="${log-path}/indianads-%d{yyyy-MM-dd}-%i.log">
            <PatternLayout>
                <pattern>%d{dd/MMM/yyyy HH:mm:ss,SSS}- %c{1}:
%m%ex%n</pattern>
            </PatternLayout>
            <Policies>
                <SizeBasedTriggeringPolicy size="1 MB"/>
            </Policies>
            <DefaultRolloverStrategy max="24"/>
        </RollingFile>
    </Appenders>
    <Loggers>
        <Logger name="root" level="debug" additivity="false">
            <appender-ref ref="RollingFile" level="All"/>
        </Logger>
        <Root level="All" additivity="false">
            <AppenderRef ref="RollingFile"/>
        </Root>
    </Loggers>
</configuration>

Reply via email to