Home
TeamSite
log4j sanity check
thatfish
I've been bashing away this afternoon trying to get log4j working for a custom external. I've simplified things to a helloworld and still cannot get the log4j custom external class logging.
The HelloWorld external works fine and I can get com.interwoven.livesite to debug, however, I cannot get the custom "A1" or "com.thatfish.livesite.external.runtime.HelloWorld" log4j appender to work for my custom class (they are both appearing in my base.loggers).
Am I missing something here ?
Can someone please sanity check the attached ?
The java code and log4j are attached.
Paths as follows:
/interwoven/iw-home/local/config/lib/content_center/livesite_customer_src/src/com/thatfish/livesite/external/HelloWorld.java
/interwoven/iw-home/local/config/lib/content_center/livesite_customer_src/etc/conf/livesite_customer/log4j.xml
Find more posts tagged with
Comments
vpatel
Is your log file getting created (i.e. livesite_custom.log or tf_custom.log)?
A few things that you may want to try out:
1. Declare your logger like this instead of what you where your class name is HelloWorld but in the getLogger method you are passing A1.
Instead try something like this: protected final Log mLogger = LogFactory.getLog(this.getClass());
This obviously uses a different logger package as well: org.apache.commons.logging.Log; You can use what you have but I use the one that I have specified here -- shouldn't matter really.
2. Try placing your log4j.xml under lstk/etc/classes/log4j.xml and do a LS TK build. Make sure that post-build your log files are getting created. Also look for any errors/warnings related to log4j configurations in servletd log file...
HTH!
BirtXMLDataSourceTest.zip
thatfish
Many thanks for your input - it helped me get on right track.
Perhaps I should have stated that I was in previewing.
Yes log file are getting created
Looking in the log4j files my thatfish logging gets into a couple of files on a build.
./content_center/WEB-INF/conf/livesite_customer/log4j.xml
./iw-preview/WEB-INF/conf/livesite_customer/log4j.xml
Manuallly updating. /interwoven/iw-home/httpd/webapps/iw-preview/WEB-INF/classes/log4j.xml has done the trick.
Not ideal but it should do for now.
Thanks again.