ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guido García Bernardo <ggb...@tid.es>
Subject Re: iBATIS and log4j
Date Tue, 07 Feb 2006 12:11:38 GMT
I had the same problem when using ibatis 2.0.9 + tomcat 4.1.x (I think 
there is a conflict with the commons-logging.jar).
It works fine for me with other servers (Sun ONE)...

iBatis 2.1.5 removed commons-logging dependency, maybe you are using an 
older version...

http://mail-archives.apache.org/mod_mbox/ibatis-user-java/200504.mbox/%3C91ll51tfp5s49s57v7or4k5gbgea2fpqkm@4ax.com%3E

Good look,
Guido García Bernardo.

PD: This is my WEB-INF/classes/log4j.properties:

    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%3p %d{ABSOLUTE} [%t 
%c{1}] - %m%n

    log4j.logger.com.ibatis=DEBUG, stdout
    log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG, stdout
    log4j.logger.java.sql.Connection=DEBUG, stdout
    log4j.logger.java.sql.Statement=DEBUG, stdout
    log4j.logger.java.sql.PreparedStatement=DEBUG, stdout
    log4j.logger.java.sql.ResultSet=DEBUG, stdout


Davide Marche escribió:
> Hi everybody,
>
> i am trying to use iBATIS (with DAO) in my web application, but i have a
> problem when I try to use log4j. In a standalone application i don't
> have any problem with log4j, but in this web application i cannot find a
> way for iBATIS to use log4j and to use log4j in the other parts of my
> web application.
> In other words, i created the file log4j.properties and put it into the
> default package (which is WEB-INF/classes when you deploy the
> application), and i am sure the file itself is correct (it perfectly
> works if i load it in a servlet). Just it seems iBATIS cannot find it.
> Then i tryed to write an InitServlet that id loaded at the startup
> (with<load-on-startup>1</load-on-startup>). It works from the log4j
> point of view, because i am actually able to use it from my servlets,
> but iBATIS still doesn't see it and doesn't log anything.
> If it can help i also noticed that sometimes when the application starts
> using the iBATIS DAO objects i receive this message
>
> finalized appender named [name_of_the_appender]
>
> and it actually stops logging at all. In few words, it seems like a
> conflict.
> My question is: is there anybody who managed to use iBATIS (and log4j)
> in a web application AND use log4j in the business and application logic?
> I tryed to look for informations about how iBATIS initialize log4j but i
> couldn't find anything.
>
> Any help or hint would be appreciated
>
> Thanks in advance,
> Davide Marche
>
>
>   


-- 
Guido García Bernardo
have a nice wifree !

Tfn. +34 983 54 89 08
ITDEUSTO - Valladolid


Mime
View raw message