Discussion

Change log location path

We have 2 JVMs in a cluster running on the same physical server. The problem is, the PRPC alert, prdbutil alert, system logs are being written to the same location( to the same file names) . Each JVM will be reading the same prlogging.xml ( under installed Apps)
Can someone expalin how to change the file names so as to prepend the log names with the JVM name AND/OR have a different log location for each JVM.

**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

August 24, 2010 - 10:46am

Thanks for the info Lingasamy.

But In our scenario, we have 2JVMs(clustered), which have a single ear/application file from where they are being read -- and the path is:

/opt/WebSphere/AppServer/profiles/apps/app_test/installedApps/Cell01/prdbutil_war.ear/prdbutil.war/WEB-INF/classes/prlogging.xml

This is basically reading the common prlogging.xml and writing them to the common location: "/opt/WebSphere/AppServer/profiles/apps/app_test/" with the same name. Is there a way to prepend it with some JVM name?

Pega
August 25, 2010 - 11:36am

To make this work you will have to do 2 things: Create separate copies of prlogging.xml in a new location for each server and then edit that configuration to write the files to different locations.

Since you are using WebSphere the easiest way to define the location of the logging configuration is by mapping it to a URL resource.

1. Create a URL resource with server scope for each server with the path and file name of the individual prlogging config file that you will create. For example: /apps/prpc/config/prlogging_s1.xml

2. Edit the deployment descriptor for PRPC and map the resource URL

3. Copy the original prlogging.xml to the new location (one per server) and rename it. If you have deployed the ear file you will have to extract prlogging.xml from APP-INF/lib/pega/prresources.jar

4. Edit the 2 files to include the path where you want the logs to be stored. For example: value="'/logs/prpc/server1/PegaRULES-'yyyy-MMM-dd'.log'"

Then do the same for prdbutil ... and restart the servers

August 23, 2010 - 3:43pm

If you have 2 PEGA applications, it should read its own prlogging.xml.
It does not matter it is in same physical server or not.

For example
One PEGA application is installed in location below
/opt/was51/AppServer/installedApps/XXXX/ApplicationName_01.ear/APP-INF/classes/prlogging.xml
Another can be installed on same physical machine
/opt/was51/AppServer/installedApps/XXXX/ApplicationName_02.ear/APP-INF/classes/prlogging.xml

So you can configure different log file names in different prlogging.xml.

If it is different node, but same application name also, it should read it own prlogging.xml
/opt/was51/AppServer/installedApps/XXXX/ApplicationName_01.ear/APP-INF/classes/prlogging.xml
Another can be installed on same name in different node
/opt/was51/AppServer/installedApps/XXXX/ApplicationName_01.ear/APP-INF/classes/prlogging.xml

Still prlogging.xml is different.

April 21, 2014 - 1:50am

Does it work for anybody pls let me know.

Thanks,

Baidurjya

April 24, 2014 - 12:14pm

Hi,

i wanted to chage the path for pega alert log and pega rule log . I am using weblogic 10

.its PEGA6.3sp1.

 how can wedo it? after making chage do we require any deployement? i wanted to make chage on production.

Please help.

 

Regards,

saurabh

June 17, 2014 - 2:51am

any update?

Thanks,
Baidurjya

April 1, 2015 - 5:52am

any update?

Thanks,

Baidurjya

Pega
April 1, 2015 - 1:23pm

Hi BaidurjyaC,

Yes, it is possible to change the default location of all the Pega Log files. This requires you modify the prlogging.xml file embedded in the prpc_j2ee14.ear file on the Application Server and then restart the Application Server. The prlogging.xml file can be found in the prpc_j2ee14.ear>APP-INF>lib.

In Pega 7.1 the default entry in prlogging.xml for the Alert Log is:

<appender name="ALERT" class="com.pega.pegarules.priv.util.FileAppenderPega">

            <param name="FileNamePattern" value="'@{web.tmpdir}/PegaRULES-ALERT-'yyyy-MMM-dd'.log'"/>

            <layout class="com.pega.apache.log4j.PatternLayout">

                        <param name="ConversionPattern" value="%m%n" />

            </layout>

</appender>

Here is an example of a modification to place the Alerts log file into a "logs" folder instead (in this particular example I am running PRPC on JBoss on a Windows 7 64 bit OS:

<appender name="ALERT" class="com.pega.pegarules.priv.util.FileAppenderPega">

            <param name="FileNamePattern" value="'C:/jboss-5.0.1.GA/server/pega/log/PegaRULES-ALERT-'yyyy-MMM-dd'.log'"/>

            <layout class="com.pega.apache.log4j.PatternLayout">

                                    <param name="ConversionPattern" value="%m%n" />

            </layout>

</appender>

You can read more about How to customize logs with the prlogging.xml file with this PDN Article:  https://pdn.pega.com/system-operations/how-to-customize-logs-with-the-prloggingxml-file

Let me know if this helps.

Regards,

Henry

Pega Academy

April 3, 2015 - 5:13am

Thanks Henry very much kindly. It is working.