Log4j2: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
(Created page with "==log4j2.xml== <source lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <Configuration> <Properties> <Property name="finology.log.format">%d{MMM dd, yyyy HH:mm:s...")
 
No edit summary
Line 1: Line 1:
==log4j2.xml==
<source lang="xml">
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>

Revision as of 03:14, 13 January 2021

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
    <Properties>
        <Property name="finology.log.format">%d{MMM dd, yyyy HH:mm:ss a} %c [METHOD: %M , LINE: %L]%n[%-5p][%t] %m%n</Property>
        <Property name="finology.log.file.gz">${finology.log.dir}/%d{yyyyMM}/SPIDER-%d{yyyyMMdd}-%i.log.gz</Property>
        <Property name="finology.log.dir">${sys:user.home}/.shahed/finology/var/log/http</Property>
        <Property name="finology.log.file">${finology.log.dir}/SPIDER.log</Property>
    </Properties>
    <Appenders>
        <RollingFile name="file" fileName="${finology.log.file}" filePattern="${finology.log.file.gz}" ignoreExceptions="false">
            <PatternLayout pattern="${finology.log.format}"/>
            <Policies>
                <SizeBasedTriggeringPolicy size="10 MB"/>
                <TimeBasedTriggeringPolicy interval="1"/>
                <OnStartupTriggeringPolicy />
            </Policies>
            <DefaultRolloverStrategy max="20"/>
        </RollingFile>
        <Console name="console" target="SYSTEM_OUT">
           <PatternLayout pattern="${finology.log.format}"/>
        </Console>
        <Async name="async">
            <AppenderRef ref="file"/>
            <AppenderRef ref="console"/>
        </Async>
    </Appenders>
    <Loggers>
        <Logger name="biz.shahed.finology.http.spider.mapper" level="warn"/>
        <Logger name="springfox.documentation" level="warn"/>
        <Logger name="edu.uci.ics.crawler4j" level="error"/>
        <Logger name="org.apache.activemq" level="warn"/>
        <Logger name="biz.shahed.finology" level="info"/>
        <Logger name="org.springframework" level="warn"/>
        <Logger name="org.apache.camel" level="warn"/>
        <Logger name="org.thymeleaf" level="warn"/>
        <Logger name="javax.servlet" level="warn"/>
        <Logger name="bitronix.tm" level="warn"/>
        <Logger name="org.jasypt" level="warn"/>
        <Logger name="org.quartz" level="warn"/>
        <Logger name="com.zaxxer" level="warn"/>

        <Root level="info">
            <AppenderRef ref="async"/>
        </Root>
    </Loggers>
</Configuration>

References