I think that slf4j is not working in my setup and it might have nothing to
do with Tomcat. As a matter of fact, I assume I don't even have to have
log4j or slf4j working with tomcat, but that as long as my POM references
the correct dependencies, my application should log correctly?
To overcome the following error, I had to upgrade by slf4j and log4j deps to
the latest version.
Caused by: java.lang.IllegalAccessError: tried to access field
org.slf4j.impl.StaticLoggerBinder.SINGLETON from class
org.slf4j.LoggerFactory
These are my maven deps.
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.6</version>
</dependency>
I see the same behaviour in Glassfish and tomcat. Does anybody have
slf4j-1.5.6 working with log4j-1.2.14?
I am stumped?!
P
On Fri, Jul 24, 2009 at 9:22 AM, pieter claassen <[email protected]>wrote:
> I am trying to get my application to log to a separate file with the
> following log4j.properties (server is tomcat6 in netbeans). I enabled the
> following in my wicketapplication.
>
> getRequestLoggerSettings().setRequestLoggerEnabled(true);
>
> What I find is that catalina.{date}.out logs the requests correctly, but I
> get tomcat startup info in my logfile and then nothing else.
>
> Any ideas?
>
> Thanks,
> Pieter
>
> /var/log/webapp/application.log
> ========================
>
> 2009-07-24 09:21:28,052 INFO - ContextLoader - Root
> WebApplicationContext: initialization started
> 2009-07-24 09:21:28,082 INFO - XmlWebApplicationContext - Refreshing
> org.springframework.web.context.support.xmlwebapplicationcont...@1077092:
> display name [Root WebApplicationContext]; startup date [Fri Jul 24 09:21:28
> CEST 2009]; root of context hierarchy
> 2009-07-24 09:21:28,134 INFO - XmlBeanDefinitionReader - Loading XML
> bean definitions from ServletContext resource
> [/WEB-INF/WicketApplicationDefinition.xml]
> 2009-07-24 09:21:28,555 INFO - XmlWebApplicationContext - Bean factory
> for application context
> [org.springframework.web.context.support.xmlwebapplicationcont...@1077092]:
> org.springframework.beans.factory.support.defaultlistablebeanfact...@1ab5e0b
> 2009-07-24 09:21:28,582 INFO - DefaultListableBeanFactory -
> Pre-instantiating singletons in
> org.springframework.beans.factory.support.defaultlistablebeanfact...@1ab5e0b:
> defining beans [myDataSource,appConfig,WicketApplication]; root of factory
> hierarchy
> 2009-07-24 09:21:29,172 INFO - ContextLoader - Root
> WebApplicationContext: initialization completed in 1120 ms
>
>
> log4j.properties
> ==============
> log4j.rootLogger=INFO, file
>
> log4j.appender.file=org.apache.log4j.RollingFileAppender
> log4j.appender.file.maxFileSize=100KB
> log4j.appender.file.maxBackupIndex=5
> log4j.appender.file.File=/var/log/${application.name}/application.log
> log4j.appender.file.layout=org.apache.log4j.PatternLayout
> log4j.appender.file.layout.ConversionPattern=%d %-5p - %-26.26c{1} - %m\n
>
>
> log4j.catagory.org.apache.wicket.protocol.http.RequestLogger=INFO
> log4j.logger.org.apache.wicket=INFO
> log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO
> log4j.logger.org.apache.wicket.version=INFO
> log4j.logger.org.apache.wicket.RequestCycle=INFO
>
> --
> Pieter Claassen
>
>
--
Pieter Claassen
musmato.com