File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting up log4j in an applicationcontext

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33670
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some Spring code that I'm calling via instantiating a new ApplicationContext (because it is being called from an EJB in an app without a front end.) I'm trying to figure out how to tell it about the location of log4j. Normally we store our debugging property file in /config/log4j... or the like. The root of that is in the classpath, but the log4j file itself is not. Is there a way I can tell Spring/Hibernate where to find the log4j file directly? In a web app, I'd use a listener, but no web app here.
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just put the log file into the root of your classpath. If you put it into a config directory. Add that directory to your classpath.

http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/overview.html#d0e826

Mark
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33670
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. Ok. Do the obvious and put it where Spring says it should go.
 
Mark Spritzler
ranger
Sheriff
Posts: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Ok. Ok. Do the obvious and put it where Spring says it should go.


Well, not necessarily. You can put it anywhere, just set that anywhere to be part of the classpath.

Mark
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic