You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jaime Marcondes <ja...@objetto.com.br> on 2004/02/27 03:36:27 UTC

Configure Log4j and Commons Loggin

Hi!

    I tried to configure a web application with commons-logging.jar e log4.jar, put in the WEB-INF/lib directory, but when task deploy of ant is executed, prints this error:

installwar:
   [deploy] FAIL - Encountered exception java.io.IOException: org.apache.commons
.logging.LogConfigurationException: java.lang.InstantiationException: org.apache
.log4j.Logger


BUILD FAILED
C:\Fontes\Web\Latina\build.xml:366: FAIL - Encountered exception java.io.IOExcep
tion: org.apache.commons.logging.LogConfigurationException: java.lang.Instantiat
ionException: org.apache.log4j.Logger


    I make the log4j.properties in WEB-INF/classes:

log4j.logger.objetto.simple=DEBUG, simple

# This will log to a file
log4j.appender.simple=org.apache.log4j.FileAppender
log4j.appender.simple.File=log4jsimple.log

# simple layout 
log4j.appender.simple.layout=org.apache.log4j.SimpleLayout


    and so commons-logging.properties in WEB-INF/classes:

org.apache.commons.logging.LogFactory=org.apache.log4j.Logger



    Thank's for help.

Re: Configure Log4j and Commons Loggin

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 27 Feb 2004, at 02:36, Jaime Marcondes wrote:

> org.apache.commons.logging.LogFactory=org.apache.log4j.Logger
                                        ^^^^^^^^^^^^^^^^^^^^^^^
i think that you need the full name of the factory class there but i 
suspect that (if you want to log to log4j) you should be able to remove 
that line entirely (unless you were trying to specify a custom 
LogFactory of your own devising).

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org