-->
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: XML config file for Log4J...
PostPosted: Wed Mar 02, 2005 6:59 pm 
Newbie

Joined: Tue Mar 01, 2005 11:00 am
Posts: 3
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0 rc1

Is it possible to use XML config file intead of properties one for Log4J???

Thanks a lot

Z...


Top
 Profile  
 
 Post subject: Re: XML config file for Log4J...
PostPosted: Wed Mar 02, 2005 8:18 pm 
Newbie

Joined: Tue Mar 01, 2005 11:00 am
Posts: 3
Ok i just noticed several things by experimenting:

Yes. Both XML and properties config files for Log4J will work.
That is nice, but....


Log4J config files HAVE to be at the root of compiled classes.


for example:
For:
/build/classes/org/company/blah/blah/*.class
log4j.xml has to be under /build/classes/
If I put it anywhere else it wont be "picked up" which contradicts with documentation (it says it just has to be in the classpath)...


Now, I made a nice package for my hibernate configs like
/src/java/org/company/webapp/hibernate/

where I keep my hibernate config file.
I would like to keep other config files that relate to hibernate under the same package (log4j.xml, oscache.properties, ehcache.xml, etc, etc)...

It would be nice if one could specify the hibernate.cfg.xml the location of other relevant config files.






zambak wrote:
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0 rc1

Is it possible to use XML config file intead of properties one for Log4J???

Thanks a lot

Z...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 11:50 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Quote:
which contradicts with documentation (it says it just has to be in the classpath)

Um thats the general definition of "in the classpath".

And it does not *have* to be in the classpath. Have you taken a look at the log4j documentation? Oddly enough it describes configuring log4j ;)

The other stuff is completely superfluous as they all relate to caches. Simply plugin a custom CacheProvider which reads the configuration file from where ever you want.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 9:38 am 
Newbie

Joined: Tue Mar 01, 2005 11:00 am
Posts: 3
Hi Steve

Thanks for the reply. I used log4j for quite some time now, and I understand that you can specify the location of the config file. But I don't want to write the unnecessary code that will initialize log4j when hibernate is allready doing that.

But, as I allready mentioned, hibernate will initialize the log4j only if it finds the config file under the "root" of the class package (according to the tests I did).

So the following wont work:

/org/company/package1/*.class
/org/company/package2/*.class
/org/company/hibernate/hibernate.cfg.xml
/org/company/hibernate/oscache.properties
/org/company/hibernate/log4j.xml

untill I move log4j.xml under / as in
/log4j.xml


Furthermore, the cache config file will work fine also being in any (sub) package...



I hope this clarifies my problem.

Z...






steve wrote:
Quote:
which contradicts with documentation (it says it just has to be in the classpath)

Um thats the general definition of "in the classpath".

And it does not *have* to be in the classpath. Have you taken a look at the log4j documentation? Oddly enough it describes configuring log4j ;)

The other stuff is completely superfluous as they all relate to caches. Simply plugin a custom CacheProvider which reads the configuration file from where ever you want.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 7:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hibernate does not configure anything explicitly - that would be bad behavior.

it uses common-logging which does it thing - using an already configured log system.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 03, 2005 7:01 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hibernate does not configure anything explicitly - that would be bad behavior.

it uses common-logging which does it thing - using an already configured log system.

_________________
Max
Don't forget to rate


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.