This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

using Log4j WSAD

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i'm using Log4j for logging in my application Which is in WSAD.

I put the commons-logging.properties and log4j.properties under


web-inf\classes


and log4j-1.2.8.jar under web-inf\lib folder.

While running it is giving error messages like

log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
[10/11/04 11:27:13:375 IST] 2460ca7b SystemErr R log4j:WARN Please initialize the log4j system prop

what is the solution for that
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear bala.

first you try this

Create a folder in inside web-inf and place your log4j into same folder.

but placing log4 inside web-inf will make it available to web Container only
 
siva kumar
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
Shailesh i have done that.

Still it's giving same error.

log4j.xml to be in the same folder or what.

thanx for your help
 
Shailesh Chandra
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Bala ,

I am not aware that how you are implementing log4j but I explain you my implemtaion. This may Help you.

1) We have imported following classes

org.apache.log4j.Logger;
org.apache.log4j.PropertyConfigurator;

2) Then we are intialiazing out log4j by

PropertyConfigurator.configure(fileName) here file name is complete path of log4j.properties.

I think you are using log4j.xml instead of log4j.properties but that hardly makes any difference.

3) since we are using logger in ejb container also hence I had to put log4j.jar in my application lib instead of web-inf\lib

tell me how you are initialiazing your configuraion of log4j
[ October 11, 2004: Message edited by: Shailesh Chandra ]
 
siva kumar
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Shailesh

thanx 4 your coop.

I have got it.

it's working fine.

raja
 
Something about .... going for a swim. With this tiny ad ...
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!