Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

By default log files are rotated on the following events:

  • if the size of a single log file exceeds 100MB or
  • on day change.

...

Code Block
languagexml
titleJOC Cockpit log4j2.xml
linenumberstrue
collapsetrue
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
        <Properties>
                <?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
	<Properties>
		<Property name="TimeZone">{Etc/UTC}<>Etc/UTC</Property>
                <Property name		<Property name="RetainDays">30d</Property>
                		<Property name="NumOfFilesPerDayMaxSizeOfRolledOverFiles">5<>5 GB</Property>
                		<Property name="MaxSizePerFile">100MB<>100 MB</Property>
		
		<!-- Log level of the Root Logger. -->
		<Property name="RootLogLevel">INFO</Property>
		<!-- Configurations for 2nd debug log files  <!--Configuration for loggers(OFF|DEBUG|TRACE) 
			 If one of thethese webvalues servicesis in joc.log
                        Possibly values are ERROR, WARN, INFO, DEBUG, TRACE
                        Default: INFO
                -->
                <Property name="RootLogLevel">info</Property>

                <!--Configuration for an extra database log file (database-debug.log) if necessary
                        OFF: without extra log
       set to DEBUG or TRACE then the above 
			 RootLogLevel has to have the same value.
		-->
		<Property name="JocLogLevel">OFF</Property>
		<Property name="ClusterLogLevel">OFF</Property>
		<Property name="HistoryLogLevel">OFF</Property>
		<Property name="DailyPlanLogLevel">OFF</Property>
		<Property name="CleanupLogLevel">OFF</Property>
		<Property name="AuthLogLevel">OFF</Property>
		<Property name="ConnectionPoolLogLevel">OFF</Property>
	</Properties>
    <Appenders>
		<!-- Appender for audit log -->
		<RollingFile name="AuditLogAppender" 
			fileName="${sys:user.dir}/logs/audit.log" 
			filePattern="${sys:user.dir}/logs/audit-%d{yyyy-MM}-%i.log.gz"
			createOnDemand="true">
			<PatternLayout 
				pattern="%d{ISO8601}{${TimeZone}} %-5p %m%throwable{short}%n" 
				charset="UTF-8"/>
			<Policies>
				<TimeBasedTriggeringPolicy/>
				<SizeBasedTriggeringPolicy size="${MaxSizePerFile}"/>
			</Policies>
			<DefaultRolloverStrategy fileIndex="nomax"/>
		</RollingFile>

        <!-- Appender for connection pool log -->
    ERROR, WARN, INFO, DEBUG, TRACE: creates extra log with corresponding log level ...
        </Appender>
    </Appenders>
            SQL statement are included from DEBUG and their binding with TRACE
                -->
                <Property name="DatabaseLogLevel">off</Property>

                <!--Configuration for an extra shiro log file (shiro.log) if necessary
                        OFF: without extra log
                        ERROR, WARN, INFO, DEBUG, TRACE: creates extra log with corresponding log level
                        SQL statement are included from DEBUG and their binding with TRACE
                -->
                <Property name="AuthLogLevel">off</Property>
        </Properties>
        <Appenders>
                <!-- Appender for audit log -->
                <RollingFile name="AuditLogAppender"
                        fileName="${sys:user.dir}/logs/audit.log"
                        filePattern="${sys:user.dir}/logs/audit-%d{yyyy-MM}-%i.log.gz"
                        createOnDemand="true">
                        <PatternLayout
                                pattern="%d{ISO8601}${TimeZone} %-5p %m%throwable{short}%n"
                                charset="UTF-8"/>
                        <Policies>
                                <TimeBasedTriggeringPolicy/>
                                <SizeBasedTriggeringPolicy size="${MaxSizePerFile}"/>
                        </Policies>
                        <DefaultRolloverStrategy fileIndex="nomax"/>
                </RollingFile>

                <!-- Appender for connection pool log -->
                ...
        </Appenders>
        ...
<Configuration>

Explanations:

...
<Configuration>

Explanations:

  • To modify the time zone that is applied to log entries and to the point in time of log rotation modify <Property name="TimeZone">{Etc/UTC}</Property>. The time zone is specified during installation.
  • To change the log retention period modify <Property name="RetainDays">30d</Property> to some other value. Consider to use the suffix d(ays), w(eeks), m(onths).
  • To limit space consumption of all log files modify <Property name="MaxSizeOfRolledOverFiles">5 GB</Property> to some other value. Consider to use the units MB, GB.
  • To limit the max. size of individual log files modify <Property name="MaxSizePerFile">100 MB</Property> to some other value. Consider to use the units MB, GB.
  • To enable debug mode modify <property name="RootLogLevel">INFO</property> to DEBUG. In addition modify the value of one or more of the following properties to enable debug output with the respective debug log file: 


    Log FileProperty
    joc-debug.log<Property name="JocLogLevel">OFF</Property>
    service-cluster-debug.log<Property name="ClusterLogLevel">OFF</Property>
    service-history-debug.log<Property name="HistoryLogLevel">OFF</Property>
    service-dailyplan-debug.log<Property name="DailyPlanLogLevel">OFF</Property>
    service-cleanup-debug.log<Property name="CleanupLogLevel">OFF</Property>
    authentication-debug.log:<Property name="AuthLogLevel">OFF</Property>
    connection-pool-debug.log<Property name="ConnectionPoolLogLevel">OFF</Property>
  • To modify the time zone that is applied to log entries and to the point in time of log rotation modify <Property name="TimeZone">{Etc/UTC}</Property>. The time zone is specified during installation.
  • To enable debug mode modify <property name="LogLevel">INFO</property> to DEBUG.
  • To change the log retention period modify <Property name="RetainDays">30d</Property> to some other value. Consider to use the suffix d(ays), w(eeks), m(onths).
  • To limit the max. size of individual log files modify <Property name="MaxSizePerFile">100MB</Property> to some other value. Consider to use the units MB, GB.
  • To limit space consumption of all log files modify <Property name="MaxSizeOfRolledOverFiles">5GB</Property> to some other value. Consider to use the units MB, GB.