I have a JSP which uses a java class as the client to the EJB's. This is the same client that I use in none web apps to invoke the EJB's.
For the "Fat" Client" the loging works, for the "Thin Client" it doesnt produce a "client.log" file.
This is all packed up in an ear, which is made up of an har, and jar for the jar with the ejbs and ofcourse a "war" for the web app.
I have a log4j.xml in the WEB-INF/classes folder. I do not have a log4j.jar in the WEB-INF/lib folder.
I checked the http://wiki.jboss.org/wiki/Wiki.jsp?page=Logging, but didnt pull out any think that seems to help me here.
Some snipits of the code.
log4j.xml
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### direct messages to file client.log ###
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=client.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### set log levels - for more verbose logging change 'info' to 'debug' ###
log4j.rootLogger=warn, stdout, file
### Set the log level for de.mediacare.* that should be logged
log4j.logger.de.somewhere=debug
The class doing the loging call (shortend to what I thought is important)
...
import org.jboss.logging.Logger;
...
private Logger log;
...
if(doLogging){
log= (log==null) ?getLogging() :log;
log.debug(details);
}
...
details is a String containing the info to be logged.
I debuged this part and all looks nice.
I'll be glad for any hints, tipps links :)
Thanks ahead!
Sincerely
Marc