File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes Log4j writing problem in websphere 7.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Log4j writing problem in websphere 7.0" Watch "Log4j writing problem in websphere 7.0" New topic

Log4j writing problem in websphere 7.0

siva kumarl

Joined: Nov 29, 2008
Posts: 21
Dear Friends,

I am not able to write log file with specifed location, I have 2 EAR applications deployed in Websphere Application Server 7.0. Each EAR file contian a WAR file inside it. The log files have different path for all the applications. For Example:

Following is the log file path mentioned in the file for all the 3 EAR applications:

EAR application 1: log4j.appender.log.File=C:/EAROne/log/EAROne.log
EAR application 2: log4j.appender.log.File=C:/EARTwo/log/EARTwo.log

The problem is, if i execute any EAR application. all the logs are written in the same log file. Suppose if i execute application EAROne, the logs generated from the application are written in the EAROne.log. Similarly, if i execute applications EARTwo and EARThree, the logs generated from those applications are also written in the same EAROne.log file.

Even i have change the parent class loading settings for the server as below

Servers -> Server Types -> WebSphere application servers -> servername -> General Properties
Server-specific Application settings as
Classloader policy : Multiple
Class loading mode : Classes loaded with local class loader first(parent last).

How to make the applications write their respective logs in their own log files according to the log file paths mentioned in their respective file?

Thanks in Advance,
Siva Kumar.
basudeva kar

Joined: Jul 23, 2012
Posts: 2
Not Sure if you can write your logs to different log files if you have deployed multiple applications in the same jvm instance in websphere application server. But if you deploy each application in a different jvm instance then it will work.
siva kumarl

Joined: Nov 29, 2008
Posts: 21
Hi Basudev,

Thanks for your reply. All applications in same profile, will this make any problem. I hope this will not a problem. Could you please let me know if any alternate solution.

Siva Kumar.
I agree. Here's the link:
subject: Log4j writing problem in websphere 7.0
It's not a secret anymore!