the corner office

a blog, by Colin Pretorius

« Ken v Boris | Main | SpringSource Application Platform »

# CXF, log4j, silly mistakes

If you were using CXF, and wanted all the logging output to be handled by log4j, you'll probably have Googled for an answer and come across this excellent post which explains how to configure CXF to use log4j. And you might duly create the necessary file in src/main/webapp/META-INF or the like and then spent a lot of time debugging CXF's LogUtils class trying to figure out why it isn't picking up your config change.

Only then might you realise that the post in question is indeed correct, and explains exactly what you need to do: put the string org.apache.cxf.common.logging.Log4jLogger into a file named META-INF/cxf/org.apache.cxf.Logger in the classpath. In the classpath. And then you'll go doh! Muppet! A web app's META-INF directory isn't in the classpath, and your mind is making a connection which isn't there. You should be putting the file into src/main/resources directory, or whereever else in your classpath. Classpath dammit, classpath. And you might feel embarassed at having made this silly mistake, but you'd only be human. And I think Donald Norman would be on your side.

File under: techie : {2008.05.01 - 23:54}

Add a comment

Your name (mandatory):

Your email:
Your email address is not displayed
Your home page:

Comment (sorry, no HTML):

Remember details?
Yes No

meta

-home-
about
contact
disclaimer
articles
code
link blog

style: [?]
[plain.dark.blue]

Categories

java
linux
music
notes/domino
personal
politiek
studies
techie
thee_blog
world

RSS Feeds

rssfeed all posts
rssfeed all cmts
rssfeed tech posts
rssfeed tech cmts

Archives

2008.07
2008.06
2008.05
2008.04
2008.03
2008.02
2008.01
2007.12
2007.11
2007.10
2007.09
2007.08
2007.07
2007.06
2007.05
2007.04
2007.03
2007.02
2007.01
2006.12
2006.11
2006.10
2006.09
2006.08
2006.07
2006.06
2006.05
2006.04
2006.03
2006.02
2006.01
2005.12
2005.11
2005.10
2005.09
2005.08
2005.07
2005.06
2005.05
2005.04
2005.03
2005.02
2005.01
2004.12
2004.11
2004.10
2004.09
2004.08
2004.07
2004.06
2004.05
2004.04
2004.03
2004.02
2004.01
2003.12
2003.11
2003.10
2003.09
2003.08
2003.07
2003.06

© Colin Pretorius