I'm having trouble finding/getting any logging output from a web service.
I have a web service running through axis2 in a Tomcat6 container, the .aar file contains this structure:
root/
log4j.properties
lib/
slf4j-api.jar
slf4j-log4j12.jar
log4j-1.2.jar
com/
all of my classes
META-INF/
services.xml
The service is simple for now, just:
public class MyService {
private static Logger log = LoggerFactory.getLogger(MyService.class);
public String echo(String toLog) {
log.error("Entered echo with [{}]", toLog);
return "Echo: " + toLog;
}
}
When run with a main command from a jar file at the command line, the logging works fine, but when accessed as a web service, no logging file is created, but no errors are encountered, either. The client does receive the "Echo: " + toLog string as it expects.
Here's the relevant bits from log4j.properties
### direct messages to file myservice.log ###
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=/var/lib/tomcat6/logs/myservice.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, file
Do I have the log4j.properties file in the wrong location? Or is something else happening here?