This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting up log4j in an applicationcontext

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
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: 17278
6
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: 34973
379
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: 17278
6
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic