This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

setting up Log4J in Orion webapps

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So - I've put the log4j.jar in my orion/lib directory, and (as per everything I've read) I've put the log4j.xml config file in the web-inf/classes directory in my war file.

but it doesn't pick it up. with debugging switched on, it wants to look only in the same directory as the log4j.jar file, which isn't what I want it to do.

if I have to, I'll put the jar file into the war (or ear) file, and put the xml file in the same directory as that, but I'd rather not have to do that. any ideas?
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've put the log4j.jar in my orion/lib directory, and ... I've put the log4j.xml config file in the web-inf/classes directory in my war file.

if I have to, I'll put the jar file into the war (or ear) file, and put the xml file in the same directory as that, but I'd rather not have to do that. any ideas?


I think that if you put the log4j.xml file into the war, you also need to put the log4j.jar into the war. As far as I know, that is the way it is typically done. Putting the xml file into the lib directory won't work.
 
Phil Johnston
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Marilyn - though I'm having great difficulty in even doing that.

I've got my ear file set up as so:

myear
/META-INF
/META-INF/MANIFEST.MF
/myejbs.jar
/log4j-1.2.9.jar
/thirdparty1.jar
/mywar.war

now - by my reckoning, this should be fine, no?

but I'm not getting my jar files picked up by myejbs.jar classes.

have I missed something out?

do I have to put an entry in my MANIFEST.MF to point to the jar files?

Thanks in advance for any help,

Phil
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

I have my log4j.jar and my log4j.properties in my Orion/lib dir.

That seems to work fine for me
 
Are you here to take over the surface world? Because this tiny ad will stop you!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic