• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

log4j doesnt work on WAR files

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there.

Im using log4j in order to see my log messages, and all works rigth, but when i try to upload my application in a WAR file, it doesnt work cause it cannot find the RealPath.

Somebody has any suggestion?

regards.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We use a plug-in for WebLogic to initialize logging during startup and we place our log files on an absolute path, like /usr2/logs/appname/appname.log and it all works well. I'm sure that other containers have such a startup mechanism.

If you try to use the classpath, it won't work because there is no 'real' path ... it's inside of the jar.

Paul
 
LAT_kNos
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well i think that you are talking about SERVER LOG's thats another things and it works right for me, but what i mean is that when i use Log4j using the listener "Log4jConfigListener" it throws an exception JUST when i have a not expanded WAR. The exception is

<14/12/2005 10:09:56 AM CST> <Warning> <HTTP> <BEA-101162> <User defined listene
r org.springframework.web.util.Log4jConfigListener failed: java.lang.IllegalStat
eException: Cannot set web app root system property when WAR file is not expande
d.>
log4j:WARN No appenders could be found for logger (org.springframework.web.conte
xt.ContextLoader).
log4j:WARN Please initialize the log4j system properly.

I tried to do probe it, taking out the lo4j.properties and the log file out of my application ant it didnt work anyway.

kNos
 
reply
    Bookmark Topic Watch Topic
  • New Topic