m.c.m.proxyma.log
Class ProxymaLoggersUtil

java.lang.Object
  extended by m.c.m.proxyma.log.ProxymaLoggersUtil

public class ProxymaLoggersUtil
extends java.lang.Object

This class handles the setup and the changes od log level of the proxyma default logger. The logger name is composed with the context name, so any instance of proxyma will have its onw logger and its own logFile.

NOTE: this software is released under GPL License. See the LICENSE of this distribution for more informations.

Version:
$Id: ProxymaLoggersUtil.java 163 2010-06-28 23:03:13Z marcolinuz $
Author:
Marco Casavecchia Morganti (marcolinuz) [marcolinuz-at-gmail.com]

Constructor Summary
ProxymaLoggersUtil()
           
 
Method Summary
static void initializeContextLogger(java.util.logging.Logger logger, java.lang.String fileName, java.lang.String logLevel, int maxLogSize, int logRetention)
          Initialize the logger to write on the passed file with the given log level.
static void initializeCustomLogger(java.util.logging.Logger logger, java.lang.String fileName, int maxLogSize, int logRetention)
          Initialize the logger to write on the passed file with the given log level.
static void updateLogLevel(java.util.logging.Logger logger, java.lang.String newLevel)
          Changes the log level of the context logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxymaLoggersUtil

public ProxymaLoggersUtil()
Method Detail

initializeCustomLogger

public static void initializeCustomLogger(java.util.logging.Logger logger,
                                          java.lang.String fileName,
                                          int maxLogSize,
                                          int logRetention)
Initialize the logger to write on the passed file with the given log level.

Parameters:
logger - the logger to initialize
logLevel - the log level to set
fileName - the file where to write logs.
maxLogSize - the max number of lines in a single lo file
logRetention - the max number of old log files to keep on filesystem.

initializeContextLogger

public static void initializeContextLogger(java.util.logging.Logger logger,
                                           java.lang.String fileName,
                                           java.lang.String logLevel,
                                           int maxLogSize,
                                           int logRetention)
Initialize the logger to write on the passed file with the given log level.

Parameters:
logger - the logger to initialize
logLevel - the log level to set
fileName - the file where to write logs.
maxLogSize - the max number of lines in a single lo file
logRetention - the max number of old log files to keep on filesystem.

updateLogLevel

public static void updateLogLevel(java.util.logging.Logger logger,
                                  java.lang.String newLevel)
Changes the log level of the context logger.

Parameters:
logLevel - the new logLevel


Copyright © 2010. All Rights Reserved.