Thursday, December 04, 2008

Java : Axis2 client and Log4J

I was busy testing a client developed using the Eclipse plug-ins in the previous post.

This came up with the following error message.

log4j:WARN No appenders could be found for logger (org.apache.axis2.description.AxisService).
log4j:WARN Please initialize the log4j system properly.

To set this up inside an Eclipse project:

* Create a new folder in the project called e.g. "log4j".
* Add a file to that folder called log4j.properties which contains something like:


# Set root category priority to INFO and set its only appender to A1
log4j.rootCategory=INFO, A1

# A1 is set to be a ConsoleAppender (writes to system console).
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n


* In the project's "Run Dialog", click on the "Classpath" tab / "Advanced" / "Add folder" and then browse to the "log4j" folder previously created.
* That's it

Enjoy!

3 comments:

Anonymous said...

I recently came accross your blog and have been reading along. I thought I would leave my first comment. I dont know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.

Alena

http://www.freegrantguru.comncr

Anonymous said...

Thank you!

Educate Me said...

Thanks!