Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
bpcamac
Post subject: configuring log4j  PostPosted: Sep 16, 2008 - 07:22 AM



Joined: Jan 11, 2008
Posts: 2

I've created a simple Java app in MyEclipse that uses JPA (JPA is a God-send). I noticed the generated JPA code (EntityManagerHelper and the like) use java.util.logging.Logger and I thought this could be easily managed with a log4j.properties file. But no such luck.

I'm trying to take control of the logged out[ut which is currently coming to the console. I've created a log4j.properties file and placed it in the src directory, but it has no effect.

How do I configure java logging for my project in the MyEclipse environment? Is there something more I need to do than just placing log4j.properties in the src directory?
 
 View user's profile Send private message  
Reply with quote Back to top
ernestz
Post subject: RE: configuring log4j  PostPosted: Sep 16, 2008 - 12:27 PM



Joined: Jan 04, 2007
Posts: 57

I don't have any experience with JPA, but using Hibernate, I use log4j.properties (as well as log4j.xml), but I also had to include the log4j.jar file in the classpath. Do you have log4j.jar in your classpath?
 
 View user's profile Send private message  
Reply with quote Back to top
support-nipun
Post subject: RE: configuring log4j  PostPosted: Sep 18, 2008 - 08:59 PM
Registered Member
Registered Member


Joined: Apr 18, 2007
Posts: 5657

Thats correct. The properties file needs to go into the root of your /src directory. Then Eclipse will build it into the /classes directory (where it is supposed to the placed).

Also, the log4j jar should be a part of your project.

_________________
Nipun
MyEclipse Support
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits