You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Kratika Shah (Jira)" <ji...@apache.org> on 2021/08/12 06:38:00 UTC

[jira] [Comment Edited] (LOG4J2-3135) When the application logs cross the specified roll back limit, the next logs getting created does not carry the same name as the zip file name created.

    [ https://issues.apache.org/jira/browse/LOG4J2-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17397852#comment-17397852 ] 

Kratika Shah edited comment on LOG4J2-3135 at 8/12/21, 6:37 AM:
----------------------------------------------------------------

Sure, I'm adding the configuration file in the comment.

 

 

<?xml version="1.0" encoding="UTF-8"?>
 <Configuration status="INFO" monitorInterval="30">

 <Properties>
 <Property name="logPath">${env:PROGRAMDATA}/ApplicationName/Logs</Property>
 <Property name="WebCR">WebCR</Property>
 <Property name="ArchiveSize">20MB</Property>
 <Property name="NumberOfFiles">20</Property>
 <Property name="FormatPattern">%d\{yyyy-MMM-dd EEE HH:mm:ss.SSS} %-5level [%t] - %c - %method(%[file:%line|file://%25line/]) -
 %msg%xEx%n
 </Property>
 <Property name="FormatPatternNoLocation">%d\{yyyy-MMM-dd EEE HH:mm:ss.SSS} %-5level [%t] - %c - %msg%xEx%n</Property>
 </Properties>
 <Appenders>
 <RollingFile name="WebCR" fileName="${sys:logPath}/WebCR.log"
 filePattern="${sys:logPath}/$${date:yyyy-MMM}/WebCR-%d\{yyyy-MMM-dd}-%i.log.zip"
 immediateFlush="true" append="true">
 <PatternLayout pattern="${FormatPattern}"/>
 <Policies>
 <OnStartupTriggeringPolicy/>
 <TimeBasedTriggeringPolicy/>
 <SizeBasedTriggeringPolicy size="${ArchiveSize}"/>
 </Policies>
 <DefaultRolloverStrategy max="${NumberOfFiles}" />
 </RollingFile>
 <Policies>
 <OnStartupTriggeringPolicy/>
 <TimeBasedTriggeringPolicy/>
 <SizeBasedTriggeringPolicy size="${ArchiveSize}"/>
 </Policies>
 <DefaultRolloverStrategy max="${NumberOfFiles}" />
 </RollingFile>
 </Appenders>
 <Loggers>
 <Root level="INFO">
 <AppenderRef ref="WebCR"/>
 <AppenderRef ref="STDOUT"/>
 </Root>

<logger name="com.app" level="DEBUG"/>

</logger>
 </Loggers>
 </Configuration>

 

 

Please let me know if anything else is needed.

Thanks.


was (Author: krashah):
Sure, I'm adding the configuration file in the comment.

 

 

<?xml version="1.0" encoding="UTF-8"?>
<!--
 ~ Copyright (c) 2017 Automation Anywhere. All rights reserved.
 ~ <p>
 ~ This software is the proprietary information of Automation Anywhere. You
 ~ shall use it only in accordance with the terms of the license agreement you
 ~ entered into with Automation Anywhere.
 ~ </p>
 -->

<Configuration status="INFO" monitorInterval="30">
 <!--<ThresholdFilter level="INFO"/>-->
 <Properties>
 <Property name="logPath">${env:PROGRAMDATA}/AutomationAnywhere/Logs</Property>
 <Property name="WebCR">WebCR</Property>
 <Property name="ArchiveSize">20MB</Property>
 <Property name="NumberOfFiles">20</Property>
 <Property name="FormatPattern">%d\{yyyy-MMM-dd EEE HH:mm:ss.SSS} %-5level [%t] - %c - %method(%file:%line) -
 %msg%xEx%n
 </Property>
 <Property name="FormatPatternNoLocation">%d\{yyyy-MMM-dd EEE HH:mm:ss.SSS} %-5level [%t] - %c - %msg%xEx%n</Property>
 </Properties>
 <Appenders>
 <RollingFile name="WebCR" fileName="${sys:logPath}/WebCR.log"
 filePattern="${sys:logPath}/$${date:yyyy-MMM}/WebCR-%d\{yyyy-MMM-dd}-%i.log.zip"
 immediateFlush="true" append="true">
 <PatternLayout pattern="${FormatPattern}"/>
 <Policies>
 <OnStartupTriggeringPolicy/>
 <TimeBasedTriggeringPolicy/>
 <SizeBasedTriggeringPolicy size="${ArchiveSize}"/>
 </Policies>
 <DefaultRolloverStrategy max="${NumberOfFiles}" />
 </RollingFile>
 <Policies>
 <OnStartupTriggeringPolicy/>
 <TimeBasedTriggeringPolicy/>
 <SizeBasedTriggeringPolicy size="${ArchiveSize}"/>
 </Policies>
 <DefaultRolloverStrategy max="${NumberOfFiles}" />
 </RollingFile>
 </Appenders>
 <Loggers>
 <Root level="INFO">
 <AppenderRef ref="WebCR"/>
 <AppenderRef ref="STDOUT"/>
 </Root>

<logger name="com.automationanywhere" level="DEBUG"/>
 
 </logger>
 </Loggers>
</Configuration>

 

 

Please let me know if anything else is needed.

Thanks.

> When the application logs cross the specified roll back limit, the next logs getting created does not carry the same name as the zip file name created.
> -------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-3135
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3135
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.13.3
>         Environment: Production, UAT, and Development
>            Reporter: Kratika Shah
>            Priority: Major
>
> Open file log4j2.xml in the notepad or any editor. In the Configuration section, in the file Application configuration folder\log4j2.xml, change the Number of Files as below: -
> In the same file, Go to <Properties> tag and add a line: <Property name="NumberOfFiles">20</Property> You can keep the default values as well.
> When the application logs cross the specified limit, the naming convention of the logs is not as expected.
> Example: The zip file gets created with the name App-2020-Jul-28-1.log and when we extract the log, the file name would be App-2020-Jul-28-28.log



--
This message was sent by Atlassian Jira
(v8.3.4#803005)