Question
Areteans Technology Solutions
IN
Last activity: 6 Mar 2018 6:53 EST
What is the appender for prlog4j2.xml in Pega 7.3.1 for daily log rolling?
Please inform what should be included and where in prlog4j2.xml for daily log rolling. Is the change needed for <TimeBasedTriggeringPolicy /> tag?
A part of prlog4j2.xml is given below:
<RollingRandomAccessFile name="PEGA" fileName="/pega/log1/PegaRULES-${date:yyyy-MM-dd}.log" filePattern="/pega/log1/PegaRULES-%d{MM-dd-yyyy}-%i.log.gz">
<PatternLayout>
<Pattern>%d [%20.20t] [%10.10X{pegathread}] [%20.20X{tenantid}] [%20.20X{app}] (%30.30c{3}) %-5p %X{stack} %X{userid} - %m%n</Pattern>
</PatternLayout>
<Filters>
<!--Deny message logged under ALERT log level-->
<ThresholdFilter level="ALERT" onMatch="DENY" onMismatch="NEUTRAL"/>
</Filters>
<Policies>
<TimeBasedTriggeringPolicy />
<SizeBasedTriggeringPolicy size="100 MB"/>
</Policies>
<DefaultRolloverStrategy max="20"/>
</RollingRandomAccessFile>
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
IN
HI Debraj,
The daily rolling occurs based on the date pattern in the file pattern tag.As the date pattern is already defined in the the following filepattern
filePattern="/pega/log1/PegaRULES-%d{MM-dd-yyyy}-%i.log.gz">
in the above code,the daily rollover should occur without performing any changes with the file name containing the corresponding date for each day file roll over.
EPAM Systems, Inc.
ES
Hi Debraj,
Thanks for posting on PSC.
The "prlogging.xml" file contains configuration related with daily roll of the logs. by creating separate files for each day. This is what you need If I understand your buisness requirement correctly.
Follow below steps:-
Hi Debraj,
Thanks for posting on PSC.
The "prlogging.xml" file contains configuration related with daily roll of the logs. by creating separate files for each day. This is what you need If I understand your buisness requirement correctly.
Follow below steps:-
- In the
prlogging.xml
file, locate the<appender name="ASYNC">
section. Add the following reference:<appender-ref ref="dailyRollFile"/>
- Insert the following code between the last appender entry and the first category entry:
-
<appender name="dailyRollFile" class="com.pega.apache.log4j.DailyRollingFileAppender">
-
<param name="DatePattern" value="'.'yyyy-MM-dd-HH-mm"/>
-
<param name="File" value="logs/PegaRULES-.log"/>
-
<layout class="com.pega.apache.log4j.PatternLayout">
-
<param name="ConversionPattern" value="%d{ABSOLUTE} [%20.20t] (%30.30c{3}) %-5p - %m%n"/>
-
</layout>
-
</appender>
References:-Hope it helps in addressing your business requirement, kindly notify by marking this post as answered if it does.Regards,Asif -
Areteans Technology Solutions
IN
Hi Asif,
In prlog4j2.xml I am not finding the line "<appender name="ASYNC">".
Best regards,
Debraj
EPAM Systems, Inc.
ES
As mentioned above, its for "prlogging.xml". Please refere my comments
Areteans Technology Solutions
IN
Hi Asif,
Please inform if prlogging.xml can be used with Pega 7.3.1. As prlog4j2.xml is provided in the media file of Pega 7.3.1 instead of prlogging.xml, can I use prlogging.xml of Pega 7.1.9 media with Pega 7.3.1?
Best regards,
Debraj
Pegasystems Inc.
IN
Hi Debraj,
prlogging.xml cannot be used with prpc 7.3.1.You have to use prlog4j2.xml.
EPAM Systems, Inc.
ES
Thanks, @BinduSaraf for rectification. It's anyways learning on the Product Support Community.
EPAM Systems, Inc.
ES
Do refer links for detailed implementation.
Accepted Solution
Pegasystems Inc.
IN
HI Debraj,
The daily rolling occurs based on the date pattern in the file pattern tag.As the date pattern is already defined in the the following filepattern
filePattern="/pega/log1/PegaRULES-%d{MM-dd-yyyy}-%i.log.gz">
in the above code,the daily rollover should occur without performing any changes with the file name containing the corresponding date for each day file roll over.