[Anthill-pro] Log files for AnthillPro v2 are huge

Antoine Levy-Lambert antoine at gmx.de
Thu Aug 17 11:43:14 CDT 2006


Hello Alan,

we have done something in the project where I am working 
(the cooking recipe is also attached as a text file)

:

By default, Anthill Pro logs its messages to the main Tomcat log file, which is located at $CATALINAHOME/logs/stdout.log. In fact this file contains the messages which are printed on the console if Tomcat is started from the command line. In our case, Tomcat is started as a service and stdout and stderr are redirected to $CATALINAHOME/logs/stdout.log and $CATALINAHOME/logs/stderr.log. These files can grow in size occupying all the available disc space. The notes below provide a way to control their size.

Since Anthill Pro outputs lots of messages, its logs must be separated from Tomcat logs and some restriction must be imposed on their size. Anthill Pro uses log4j as a logging framework and Tomcat uses commons-logging. Commons-logging is a wrapper around the existing logging libraries as log4j, java.util.logging, etc. So we should first configure Tomcat logging and than Anthill Pro logging:

   1. Add logging.properties file in $CATALINA_HOME/common/classes/logging.properties with the following contents. Note that this is a java.util.logging configuration:

              handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4admin.org.apache.juli.FileHandler, 5host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

              .handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

              1catalina.org.apache.juli.FileHandler.level = FINE
              1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
              1catalina.org.apache.juli.FileHandler.prefix = catalina.

              2localhost.org.apache.juli.FileHandler.level = FINE
              2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
              2localhost.org.apache.juli.FileHandler.prefix = localhost.

              3manager.org.apache.juli.FileHandler.level = FINE
              3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
              3manager.org.apache.juli.FileHandler.prefix = manager.

              4admin.org.apache.juli.FileHandler.level = FINE
              4admin.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
              4admin.org.apache.juli.FileHandler.prefix = admin.

              java.util.logging.ConsoleHandler.level = FINE
              java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler

              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler

              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].level = INFO
              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].handlers = 4admin.org.apache.juli.FileHandler

              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/AnthillPro].level = INFO
              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/AnthillPro].handlers = 5host-manager.org.apache.juli.FileHandler

   2. Add log4.configuration file in $ANTHILLPRO_HOME/conf with the following contents. Note that this is log4 configuration:

              log4j.rootLogger=INFO, file

              log4j.logger.com.urbancode=INFO, file

              log4j.appender.file=org.apache.log4j.RollingFileAppender    
              log4j.appender.file.File=logs/AnthillPro_log.txt
              log4j.appender.file.MaxFileSize=2MB
              log4j.appender.file.MaxBackupIndex=20
              log4j.appender.file.layout=org.apache.log4j.PatternLayout
              log4j.appender.file.layout.ConversionPattern=%-4r %-5p %c %x - %m%n

This configuration specifies that the maximum size of the log file is 2 MB and it is located in $CATALINA_HOME/logs/AnthillPro_log.txt; if the log file becomes more than 2MB, it is moved to AnthillPro_log.txt.no_of_backup where no_of_backup is the number of the backup and a new log file is created; if the backup files become more than 20 the oldest one is deleted.

Regards,

Antoine



-------- Original-Nachricht --------
Datum: Thu, 17 Aug 2006 16:31:11 +0100
Von: Alan Freer <alan.freer at irisfinancialsolutions.com>
An: anthill-pro at caladin.urbancode.com
Betreff: [Anthill-pro] Log files for AnthillPro v2 are huge

> Hi,
> 
> Did anyone have a chance to look at this ?
> 
> Thanks,
> Alan.
> 
> ------------------------
> 
> Our log files get huge very quickly and are filling up our filesystem.  A
> typical message is this (which gets appended 
> every millisecond):
> 
>   2850809914 INFO  com.urbancode.anthill2.impl.project.BuildTrack  -
> Unable to build BuildDefinition [owner: 
> Core-Continuous.Trunk.Continuous, buildId: 14180, build#: 14180,
> buildDate: Wed Aug 02 13:00:00 BST 2006, version: Build 
> 398] - A build is currently being built
>   INFO  [com.urbancode.anthill2.impl.project.BuildTrack] - Unable to build
> BuildDefinition [owner: 
> Core-Continuous.Trunk.Continuous, buildId: 14180, build#: 14180,
> buildDate: Wed Aug 02 13:00:00 BST 2006, version: Build 
> 398] - A build is currently being built
> 
> I tried setting the logging level to WARN but then I don't get all the
> useful output for my ant build.  How can I reduce 
> the logging level for the Anthill code but keep it at DEBUG or INFO for
> the ant build ?
> 
> Thanks,
> Alan.
> 
> -- 
> Alan Freer
> Developer
> 
> Iris Financial Solutions
> 
> 9th Floor 12 Arthur Street, London EC4R 9AB
> 
> Phone:    +44 (0) 20 7397 0400
> Fax:      +44 (0) 20 7397 0401
> Direct:   +44 (0) 20 7397 0459
> 
> www.irisfinancialsolutions.com
> 
> 
> _______________________________________________
> Anthill-pro mailing list
> Anthill-pro at lists.urbancode.com
> http://lists.urbancode.com/mailman/listinfo/anthill-pro
> 
-------------- next part --------------
By default, Anthill Pro logs its messages to the main Tomcat log file, which is located at $CATALINAHOME/logs/stdout.log. In fact this file contains the messages which are printed on the console if Tomcat is started from the command line. In our case, Tomcat is started as a service and stdout and stderr are redirected to $CATALINAHOME/logs/stdout.log and $CATALINAHOME/logs/stderr.log. These files can grow in size occupying all the available disc space. The notes below provide a way to control their size.

Since Anthill Pro outputs lots of messages, its logs must be separated from Tomcat logs and some restriction must be imposed on their size. Anthill Pro uses log4j as a logging framework and Tomcat uses commons-logging. Commons-logging is a wrapper around the existing logging libraries as log4j, java.util.logging, etc. So we should first configure Tomcat logging and than Anthill Pro logging:

   1. Add logging.properties file in $CATALINA_HOME/common/classes/logging.properties with the following contents. Note that this is a java.util.logging configuration:

              handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4admin.org.apache.juli.FileHandler, 5host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

              .handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

              1catalina.org.apache.juli.FileHandler.level = FINE
              1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
              1catalina.org.apache.juli.FileHandler.prefix = catalina.

              2localhost.org.apache.juli.FileHandler.level = FINE
              2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
              2localhost.org.apache.juli.FileHandler.prefix = localhost.

              3manager.org.apache.juli.FileHandler.level = FINE
              3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
              3manager.org.apache.juli.FileHandler.prefix = manager.

              4admin.org.apache.juli.FileHandler.level = FINE
              4admin.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
              4admin.org.apache.juli.FileHandler.prefix = admin.

              java.util.logging.ConsoleHandler.level = FINE
              java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler

              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler

              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].level = INFO
              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].handlers = 4admin.org.apache.juli.FileHandler

              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/AnthillPro].level = INFO
              org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/AnthillPro].handlers = 5host-manager.org.apache.juli.FileHandler

   2. Add log4.configuration file in $ANTHILLPRO_HOME/conf with the following contents. Note that this is log4 configuration:

              log4j.rootLogger=INFO, file

              log4j.logger.com.urbancode=INFO, file

              log4j.appender.file=org.apache.log4j.RollingFileAppender    
              log4j.appender.file.File=logs/AnthillPro_log.txt
              log4j.appender.file.MaxFileSize=2MB
              log4j.appender.file.MaxBackupIndex=20
              log4j.appender.file.layout=org.apache.log4j.PatternLayout
              log4j.appender.file.layout.ConversionPattern=%-4r %-5p %c %x - %m%n

This configuration specifies that the maximum size of the log file is 2 MB and it is located in $CATALINA_HOME/logs/AnthillPro_log.txt; if the log file becomes more than 2MB, it is moved to AnthillPro_log.txt.no_of_backup where no_of_backup is the number of the backup and a new log file is created; if the backup files become more than 20 the oldest one is deleted.



More information about the Anthill-pro mailing list