Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using Log4j WSAD

 
siva kumar
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
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • 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: 1082
Java Oracle Spring
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic