-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Log4j Problem
PostPosted: Tue Oct 18, 2005 9:53 am 
Newbie

Joined: Tue Aug 23, 2005 12:52 am
Posts: 10
Hi

Can any Help me in Logging Hibernate messages

I Have Two Log4j.properties file in my application classpath, one come with axis.jar and another in my own . Log4j is Picking the axis.jar's properties file, how do i set Log4j so that it use my properties file.

Thanks in advance
durga..


Top
 Profile  
 
 Post subject: -Dlog4j.configuration=yourlog4j.properties
PostPosted: Tue Oct 18, 2005 12:37 pm 
Newbie

Joined: Wed Sep 17, 2003 3:31 am
Posts: 10
Location: Napoli (IT)
I guess you are using JRun4... good.

Create you own log4j.properties in another file, say yourLog4j.properties and then specify the alternate log4j.configuration in JVM parameter:

java -Dlog4j.configuration=momolog4j.properties ...


Top
 Profile  
 
 Post subject: Log4j Problem
PostPosted: Wed Oct 19, 2005 3:16 am 
Newbie

Joined: Tue Aug 23, 2005 12:52 am
Posts: 10
Hi,

Thank for your reply, but it's a web application and my properties file is with in war file which we can deploy in any web server so my application will start with web server it self , and i am not using any java command to run application.

thanks in advance
durga.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 11:17 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
one possibility is to reorder the classpath, so that
your log4.properties comes first.
I am not sure if this is possible in your webapp.

Another way is to configure log4j yourself like:

Code:
org.apache.log4j.PropertyConfigurator.configure(props);


where props are the loaded Properties of log4j.properties.
See log4j forums/books/manuals for details.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 11:19 am 
Beginner
Beginner

Joined: Tue Nov 25, 2003 3:33 pm
Posts: 35
Just rip the axis.jar and remove log4j.properties from there, then merge it with yours.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 2:29 pm 
Regular
Regular

Joined: Fri Aug 29, 2003 12:48 pm
Posts: 63
i prefer to put my own log4j.properties file in WEB-INF/classes where it's both easy to inspect and change, and takes precedence over any log4j.properties files in the roots of my jars.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.