• Post Reply Bookmark Topic Watch Topic
  • New Topic

setting up log4j in an applicationcontext  RSS feed

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37181
515
Eclipse IDE Java VI Editor
  • 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: 17309
11
IntelliJ IDE Mac Spring
  • 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: 37181
515
Eclipse IDE Java VI Editor
  • 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: 17309
11
IntelliJ IDE Mac Spring
  • 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
Boost this thread!