Re: log4j in gwt environment with ibatis...

2008-11-22 Thread jhulford

I find the claim of commons-logging/log4j having issues in a gwt
+ibatis environment somewhat suspicious.  The GWT server side is
nothing more than a simple servlet invoking other classes.  While I'm
not actually using ibatis I am using commons-logging along with
another persistence framework and didn't have to do anything out of
the ordinary to utilize logging.  Where are your configuration files
and what environment are you trying to log in?

Here's a few things I noticed about your logging config.   I believe
rootCategory and rootLogger are redundant.  Logger replaced Category
awhile ago, pretty sure you can lose that line altogether.  Also,
you're duplicating your log appending for all the sub-packages under
com.ibatis.  You've already got a logger set up for com.ibatis so
anything under that subpackage is not needed unless you want to modify
the logger level/appender, which you're not doing.  Also, since you're
setting up com.ibatis to append to CONSOLE-1 every redeclaration of
the appender going to cause the output to get duplicated.  In other
words, if you did do something like add the line
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=ERROR to
increase the logging level you don't need to also redeclare the
console appender since that appender is already inherited from the
log4j.logger.com.ibatis appender earlier in your file.

On Nov 21, 6:32 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I searched the other posts in the group and didnt see a solution.
 Somebody said they got it to work but never posted the solution. I
 have -Dlog4j.debug=true -Dlog4j.configuration=...  and my
 log4j.properties has log4j.rootCategory set to STDOUT and so is
 log4j.logger. I have commons-logging and log4j in the classpath. I
 read that commons logging with log4j is a problem with iBatis on gwt.
 Anybody have this environment and can you comment on how you solved
 these issues ? Help appreciated.

 here is the log4j.properties...

 log4j.rootCategory=INFO, STDOUT
 # Use FILE-X in Application Server
 log4j.rootLogger=ERROR, FILE-1
 log4j.logger.com.ibatis=INFO, CONSOLE-1

 log4j.logger.java.sql=INFO,stdout
 log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=INFO, CONSOLE-1
 log4j.logger.com.ibatis.common.jdbc.ScriptRunner=INFO, CONSOLE-1
 log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=INFO,
 CONSOLE-1
 log4j.logger.java.sql.Connection=INFO, CONSOLE-1
 log4j.logger.java.sql.Statement=INFO, CONSOLE-1
 log4j.logger.java.sql.PreparedStatement=INFO, CONSOLE-1
 log4j.logger.java.sql.ResultSet=INFO, CONSOLE-1

 # CONSOLE is set to be a ConsoleAppender and uses PatternLayout
 log4j.appender.CONSOLE-1=org.apache.log4j.ConsoleAppender
 log4j.appender.CONSOLE-1.layout=org.apache.log4j.PatternLayout
 log4j.appender.CONSOLE-1.layout.ConversionPattern=%d{MM/dd/
 HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n

 # FILE-1
 log4j.appender.FILE-1=org.apache.log4j.RollingFileAppender
 log4j.appender.FILE-1.File=log4j.log
 log4j.appender.FILE-1.MaxFileSize=5000KB
 # Keep 3 backup files
 log4j.appender.FILE-1.MaxBackupIndex=100
 log4j.appender.FILE-1.layout=org.apache.log4j.PatternLayout
 log4j.appender.FILE-1.layout.ConversionPattern=%d{MM/dd/
 HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n

 Thx

 -- pady
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



log4j in gwt environment with ibatis...

2008-11-21 Thread [EMAIL PROTECTED]


I searched the other posts in the group and didnt see a solution.
Somebody said they got it to work but never posted the solution. I
have -Dlog4j.debug=true -Dlog4j.configuration=...  and my
log4j.properties has log4j.rootCategory set to STDOUT and so is
log4j.logger. I have commons-logging and log4j in the classpath. I
read that commons logging with log4j is a problem with iBatis on gwt.
Anybody have this environment and can you comment on how you solved
these issues ? Help appreciated.

here is the log4j.properties...



log4j.rootCategory=INFO, STDOUT
# Use FILE-X in Application Server
log4j.rootLogger=ERROR, FILE-1
log4j.logger.com.ibatis=INFO, CONSOLE-1

log4j.logger.java.sql=INFO,stdout
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=INFO, CONSOLE-1
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=INFO, CONSOLE-1
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=INFO,
CONSOLE-1
log4j.logger.java.sql.Connection=INFO, CONSOLE-1
log4j.logger.java.sql.Statement=INFO, CONSOLE-1
log4j.logger.java.sql.PreparedStatement=INFO, CONSOLE-1
log4j.logger.java.sql.ResultSet=INFO, CONSOLE-1

# CONSOLE is set to be a ConsoleAppender and uses PatternLayout
log4j.appender.CONSOLE-1=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE-1.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE-1.layout.ConversionPattern=%d{MM/dd/
HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n


# FILE-1
log4j.appender.FILE-1=org.apache.log4j.RollingFileAppender
log4j.appender.FILE-1.File=log4j.log
log4j.appender.FILE-1.MaxFileSize=5000KB
# Keep 3 backup files
log4j.appender.FILE-1.MaxBackupIndex=100
log4j.appender.FILE-1.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE-1.layout.ConversionPattern=%d{MM/dd/
HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n



Thx

-- pady

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---