I import org.apache.log4j.Logger;
then Logger log = Logger.getLogger("soap-service");
log.debug("Converting StringBuffer to String...");
Wayne Johnson wrote:
I think the problem is I'm getting the SLF4 logger under the hood, and
not log4j, so a log4j.properties file doesn't even get read.
How do you create your Log object? LogFactory?
*/Schalk <[EMAIL PROTECTED]>/* wrote:
Greetings Wayne,
This is my log4j.properties and its placed at myapp\WEB-INF\classes\
I copied it over the default Axis .properties file and everything is
working fine for me.
#Set the level for the root logger to INFO and add its appender(s)
log4j.rootLogger=INFO, CONSOLE, LOGFILE
#Set my own logger
log4j.logger.soap-service=DEBUG, CONSOLE, LOGFILE
log4j.additivity.soap-service=false
#Setting appender for output to console.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d %p [%c] - <%m>%n
#Setting for the logfile
log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.LOGFILE.File=C:/logs/error/soap/soap-service.log
log4j.appender.LOGFILE.MaxFileSize=512KB
# Keep three backup files.
log4j.appender.LOGFILE.MaxBackupIndex=3
# Pattern to output: priority NDC(remoteHost) MDC(remoteAddress)
[category] - message
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%p %x
-%X{remoteAddress}
[%c] - %m%n
Wayne Johnson wrote:
> I'm writing a Java Web Service to to user authentication for our
> applications. This is running under Jetty, which is started by the
> Tanuki service wrapper.
>
> I've got the web service somewhat working but I can't seem to get
> logging working. I've imported:
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> To the .jws program. Nothing comes out for the log.debug levels.
>
> It looks like LogFactory.getLog() is getting me a logger object for
> org.apache.commons.logging.impl.SLF4FLogFactory. I either need to
> figure out how to use that logger, or switch to the log4j logger
that
> I'm use to. I have log4j in the class path. According to the docs,
> that should be the priority logger.
>
> I tried setting the system property
>
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
> but that doesn't seem to affect anything.
>
> I've tried creating a commons-logging.properties file in various
> places. Not exactly sure what needs to go in there, I currently
have
> org.apache.commons.logging.Log=log4j.
>
> Any hints anyone?
>
> Thanks.
>
>
>
> ---
> Wayne Johnson, | There are two kinds of people: Those
> 3943 Penn Ave. N. | who say to God, "Thy will be done,"
> Minneapolis, MN 55412-1908 | and those to whom God says, "All right,
> (612) 522-7003 | then, have it your way." --C.S. Lewis
>
>
------------------------------------------------------------------------
> Expecting? Get great news right away with email Auto-Check.
>
> Try the Yahoo! Mail Beta.
>
>
>
------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.16.9/623 - Release Date:
1/11/2007 3:33 PM
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---
Wayne Johnson, | There are two kinds of people: Those
3943 Penn Ave. N. | who say to God, "Thy will be done,"
Minneapolis, MN 55412-1908 | and those to whom God says, "All right,
(612) 522-7003 | then, have it your way." --C.S. Lewis
------------------------------------------------------------------------
Don't be flakey. Get Yahoo! Mail for Mobile
<http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail> and
always stay connected
<http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail> to
friends.
------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.9/623 - Release Date: 1/11/2007 3:33
PM
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]