'How to split catalina.out for tomcat?

I have log4j2.xml properties:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout
                    pattern="%style{%d{ISO8601}}{black} %highlight{%-5level }[%style{%t}{bright,blue}] %style{%C{1.}}{bright,yellow}: %msg%n%throwable" />
        </Console>

        <RollingFile name="RollingFile"
                     fileName="/opt/tomcat/mylogs/logs.log"
                     filePattern="/opt/tomcat/mylogs/$${date:yyyy-MM}/log-%d{-dd-MMMM-yyyy}-%i.log.gz">
            <PatternLayout>
                <pattern>%d %p %C{1.} [%t] %m%n</pattern>
            </PatternLayout>
            <Policies>
                <!-- rollover on startup, daily and when the file reaches 50 MegaBytes -->
                <OnStartupTriggeringPolicy />
                <SizeBasedTriggeringPolicy
                        size="50 MB" />
                <TimeBasedTriggeringPolicy />
            </Policies>
        </RollingFile>
    </Appenders>

    <Loggers>
        <!-- LOG everything at INFO level -->
        <Root level="info">
            <AppenderRef ref="Console" level="info" />
            <AppenderRef ref="RollingFile" level="info" />
            <AppenderRef ref="SmtpAppender" level="exception"/>
        </Root>
        <Logger name="com.kot" level="debug">
            <AppenderRef ref="RollingFile"/>
        </Logger>
    </Loggers>

</Configuration>

But this properteis create logg files on another folder on server: "/opt/tomcat/mylogs/logs.log" I want to split catalina.out logs. This logs are located on "/opt/tomcat/logs/catalina.out" by default Also, how to split server logs and application logs?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source