?
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
Medium Priority
?
899 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
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…
The viewer will learn how to implement Singleton Design Pattern in Java.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

762 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