Solved

How can I create logs in to separate files for multiple applications deployed on the same instance of OC4J?

Posted on 2010-08-12
2
894 Views
Last Modified: 2013-12-01
I  am using OC4J 10.1.3.5 App server on Windows.  I have deployed 2 web applications on the same instance of OC4J where I have defined the shared library. Both applications use Struts, Spring, iBatis, apache commons libraries which I have defined as a shared library. Part of the apache loggins library I had to add log4j jar as well. So indirectly log4j-12.16.jar is declared as a shared-lib as well.

I have log4j.properties for both application pointing to different log file. But still when both applications are deployed and running, the logs are getting populated on only one file. During the deployment, I did check on webapp-classpath-first="true" setting to explicitly have log4j.properties of each individual application being load first. But nothing makes difference.

Please help.

Thanks
Jasmin
0
Comment
Question by:MehtaJasmin
2 Comments
 
LVL 4

Expert Comment

by:ProgSysAdmin
ID: 33421375
If you have attempted to configure log4j with OC4J you have probably noticed that the log file ends up in ORACLE_HOME\j2ee\PROCESS_TYPE (e.g d:\oracle\j2ee\home).

This does not work if you have multiple JVM processes per instance, since they cannot both write to the same log file. Instead you should be putting the log files in
ORACLE_HOME\j2ee\PROCESSTYPE\PROCESSTYPE_PROCESSSET_PROCESSINDEX (e.g. d:\oracle\j2ee\home\home_default_island_1\ ).

You should change your log path at runtime with the PropertyConfigurator to point at this path. These oc4j system properties provide all the necessary information:

oracle.ons.oraclehome (or oracle.home) and oracle.ons.indexid
0
 

Accepted Solution

by:
MehtaJasmin earned 0 total points
ID: 33432778
Log4j as a shared library do not let logs create into different files for multiple application installed on the same instance of OC4J. I ended up adding log4j-1.2.16.jar file into my all web application those deployed on the same instance. There after I got logs working fine into separate files.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Does a Google search find images with the word being searched? 11 60
base64 decode encode 12 119
ForLoop Example 3 40
couple of eclipse 5 16
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
This video teaches users how to migrate an existing Wordpress website to a new domain.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now