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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Eclipse with gitlab 1 79
going to wrong jsp page 2 33
jmss example java 2 23
Grunt script for Build Process 1 42
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

839 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