facebook

configuring log4j

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #289076 Reply

    bpcamac
    Member

    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?

    #289081

    ernestz
    Member

    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?

    #289187

    Loyal Water
    Member

    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.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: configuring log4j

You must be logged in to post in the forum log in