Discussion

Logger file customization

Hi,

My requirement is to generate a new  Log file  and customize the log messages that are wriiten to Log file.

we can achieve this by including appender in the prlogging.xml file but we cannot customize dispaly data as this is realted to apache tomcat logger.

 

  1. Configure  Appender name inside the Appender Tag in the prlogging.xml file

<appender-ref ref="CSMFileLog"/>

 

 

     2.    Configure the display pattern for the above appender name CSMFileLog in the prlogging.xml as below.

 

<appender name="CSMFileLog" 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 %X{stack} %X{userid} - %m%n%"/>

</layout>

 

 

can anyone help me out how to approach on this further.

 

 

thanks

Veerappa

9393008310

Incess

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

January 6, 2016 - 5:22am

I think you need to modify the layout and Conversion pattern to customize the log data.

January 19, 2016 - 12:49pm

If you are adding a new appender, I am assuming you will be using this appender somewhere in your application to log the messages. Display pattern is completely up to you, depends on how/what you want to log. You can google display patterns and keywords for log4j and you should be able to find some examples.