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
898 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
This video teaches users how to migrate an existing Wordpress website to a new domain.
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.

717 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