wood burning stoves 2.0*
The moose likes Websphere and the fly likes using Log4j   WSAD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "using Log4j   WSAD" Watch "using Log4j   WSAD" New topic
Author

using Log4j WSAD

siva kumar
Ranch Hand

Joined: Sep 03, 2004
Posts: 86
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

Joined: Aug 13, 2004
Posts: 1081

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


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
siva kumar
Ranch Hand

Joined: Sep 03, 2004
Posts: 86
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

Joined: Aug 13, 2004
Posts: 1081

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

Joined: Sep 03, 2004
Posts: 86
HI Shailesh

thanx 4 your coop.

I have got it.

it's working fine.

raja
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: using Log4j WSAD
 
Similar Threads
Maven / Tomcat issue with Servlet jar
struts & Log4J
Third party libraries and WSAD 5.1.0
log4j.properties in wsad
Configuring Log4j in my Web App