Setting Easy-Tomcat Log
Dear all,
We used to use tomcat5 and Solr on our server. But since latest CPanel, we start to use Tomcat7 that came as easy-tomcat7. Several months passed, and everything went OK till we realized that something wrong with Tomcat's logging. Each week it generates around 3GB of log, which if we look at our transaction, it absolutely make sense. But that's not what we need. Tomcat seems to log EVERYTHING.
What we need is Tomcat only log warnings and errors. That's it.
So I checked Tomcat's config to look how Tomcat sets it's log configuration. I found two files at
/usr/local/easy/share/easy-tomcat7/conf which are
logging.properties
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
#
and log4j.properties
log4j.rootLogger=debug, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.home}/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
log4j.logger.org.apache.catalina=DEBUG, R
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=DEBUG, R
log4j.logger.org.apache.catalina.core=DEBUG, R
log4j.logger.org.apache.catalina.session=DEBUG, R
So I start editing everything that says "INFO", "DEBUG", or "FINE" and set it to "WARNING". I restart easy-tomcat7 service
# /etc/init.d/easy-tomcat7 restart
and....... nothing. Tomcat still do logging in light speed. Did I missed something?
How should I change Tomcat's logging behavior to log only warnings and errors?
Any help appreciated.
Regards,
Yoachan-
Hello :) The log4j.properties file indicates that maximum file size should be 10MB. Could you verify which particular log file has reached 3GB? Thank you. 0 -
Dead Michael, Thank you for your reply, and sorry for my late reply. Here are log sizes as for now 532M catalina.err 2.2M catalina.out 497M localhost_access.log
Basically catalina.err and localhost_access.log can reach Gigs, usually 2-3 GB each week. Regards, YoChan0 -
Please open a support ticket so we can take a closer look. While Tomcat administration falls outside the scope of support, we should be able to determine if the default Tomcat logging configuration is working as intended. You can post the ticket number here so we can update this thread with the outcome. Thank you. 0 -
Dear Michael, Thank you for your suggestion. I have posted a ticket, and the ticket id is 5113103. Regards, YoChan PS. seems that I can't edit my previous post, and sorry for my greeting 'Dead Michael' which is supposed to be 'Dear Michael'.... My apologies 0 -
Ok, just in case someone stuck with this kind of problem, here's what support (finnaly) said or conclude: [QUOTE] At least for the current version of Solr, I'm seeing the same thing you see, though it uses its own log4j.properties, and I believe it is overriding them with other means, since I still see INFO and other log types. Since Solr is not provided by cPanel, I recommend contacting Solr for support on this and a workaround since it looks to be using its own settings rather than what I set, and updates the properties file upon restarting the service.
So, no luck from CPanel side.... with doubt though.... but that's the best answer I can get for now...0
Please sign in to leave a comment.
Comments
5 comments