Hi,
I'm quite new with Tomcat and Java in general. I'm deploying a Tomcat6 application and using the twitter4j library to make calls to Twitter.com. I've setup logging in Tomcat to be log4j using the following configuration:
log4j.rootLogger=ERROR, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.base}/logs/tomcat.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
And all is good. However twitter4j is choosing to log every single thing it does. As a result I end up with a huge log file that tells me nothing. Is there something I'm missing? Has anyone here tried something similar? i.e. twitter4j and Tomcat, and has some insight on how to avoid all these logs:
[twitter4j.internal.logging.Logger]: Using class twitter4j.internal.logging.SLF4JLoggerFactory as logging factory.
[twitter4j.internal.http.HttpClientFactory]: Use twitter4j.internal.http.HttpClientImpl as HttpClient implementation.
[twitter4j.internal.http.HttpClientImpl]: Request:
[twitter4j.internal.http.HttpClientImpl]: GET api.twitter.com/1/friends/ids.json?cursor=-1
[twitter4j.internal.http.HttpClientImpl]: X-Twitter-Client-URL:twitter4j.org/en/twitter4j-2.1.3-SNAPSHOT(build:e903c577fb3401b4c66037dfc477e73e6851e8e1).xml
[twitter4j.internal.http.HttpClientImpl]: X-Twitter-Client: Twitter4J
[twitter4j.internal.http.HttpClientImpl]: Accept-Encoding: gzip
[twitter4j.internal.http.HttpClientImpl]: User-Agent: twitter4j http://twitter4j.org//2.1.3-SNAPSHOT(build:e903c577fb3401b4c66037dfc477e73e6851e8e1)
[twitter4j.internal.http.HttpClientImpl]: X-Twitter-Client-Version:2.1.3-SNAPSHOT(build: e903c577fb3401b4c66037dfc477e73e6851e8e1)
[twitter4j.internal.http.HttpClientImpl]: Connection: close
[twitter4j.internal.http.HttpClientImpl]: Response:
[twitter4j.internal.http.HttpClientImpl]: HTTP/1.1 200 OK
[twitter4j.internal.http.HttpClientImpl]: X-Runtime: 0.06539
[twitter4j.internal.http.HttpClientImpl]: ETag:"89c0c8cb8befe1371d08f1b6671b08de"-gzip
[twitter4j.internal.http.HttpClientImpl]: X-Transaction:1281584957-49704-11766
[twitter4j.internal.http.HttpClientImpl]: X-RateLimit-Limit: 20000
[twitter4j.internal.http.HttpClientImpl]: X-RateLimit-Remaining: 19999
[twitter4j.internal.http.HttpClientImpl]: Content-Length: 89
[twitter4j.internal.http.HttpClientImpl]: Expires: Tue, 31 Mar 1981 05:00:00 GMT
[twitter4j.internal.http.HttpClientImpl]: Last-Modified: Thu, 12 Aug 2010 03:49:17 GMT
[twitter4j.internal.http.HttpClientImpl]: X-RateLimit-Reset: 1281588557
[twitter4j.internal.http.HttpClientImpl]: X-RateLimit-Class: api_whitelisted
[twitter4j.internal.http.HttpClientImpl]: X-Revision: DEV
[twitter4j.internal.http.HttpClientImpl]: Set-Cookie: lang=en; path=
etc, etc, etc.
Thanks so much for any insight you might have. It's really driving me insane at the moment.