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
893 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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This video teaches users how to migrate an existing Wordpress website to a new domain.
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…

763 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

7 Experts available now in Live!

Get 1:1 Help Now