Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-05-2007, 06:06 AM
Member
 
Join Date: Jun 2007
Posts: 92
Marcus is on a distinguished road
Log4J, problem with Hibernate and Spring
I have this doubt,if somebody can helps me it would be great...I have already read in a lot of websites also I published it in other forums, but everything what they said to me was not successful, as I am working with websphere 5.1, this it must be the indicated forum...

How can I do the project web reads the configuration of the log4j.properties?, I tried adding it to application context, but I haven't had the expected results, also adding listeners in the web.xml, ah! and also throwing the file within the src folder.

Marcus
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-06-2007, 04:22 AM
Senior Member
 
Join Date: Jun 2007
Posts: 114
Albert is on a distinguished road
RE: Log4J, problem with Hibernate and Spring
To log you must do an instance of the Logger class, and then to put myLogger.info for level of info, debug for level of debug and so on.
Now if you don't see what does log in, maybe it's a .propierties configuration problem or perhaps you have log4j in level debug and you do logger.info and it doesn't show you because of that.

Log other things and do a log with that same level, thus must work…
Supposing that your .properties "key" are in package calls "data", you can use a code similar to this

Code:
String key = "key"; Properties prop = new Properties(); InputStream is = this.class.getResourceAsStream ("/data/config.properties"); prop.load (is); String val = prop.getProperty (key);
Albert
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding Log4j sidiq New To Java 0 04-07-2008 08:35 PM
composite-id problem hibernate javadev Database 13 01-28-2008 09:12 AM
Lead Java developer -- Spring and Hibernate experience orjueladiego Jobs Offered 0 10-29-2007 02:50 PM
problem with hibernate and oracle 8i javadev Database 4 08-09-2007 03:21 PM
org.hibernate.ejb.Version <clinit> INFO: Hibernate EntityManager 3.2.0.CR1 Heather Database 2 06-30-2007 04:01 PM


All times are GMT +3. The time now is 03:33 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org