 |
|
 |
 |
|
 |
 |
| Author |
Message |
|
|
Post subject: configuring log4j
Posted: 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? |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: configuring log4j
Posted: 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? |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: configuring log4j
Posted: Sep 18, 2008 - 08:59 PM
|
|
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
|
| |
|
|
|
 |
|
|
| |
|
|
 |
|
 |
|
|
|
 |