fr.ifremer.isisfish.logging
Class SimulationLoggerUtil

java.lang.Object
  extended by fr.ifremer.isisfish.logging.SimulationLoggerUtil

public class SimulationLoggerUtil
extends Object

FIXME poussin, a priori cette classe ne supporte pas plusieurs simulation en meme temps, ce qui est le cas si on a plusieurs processeurs de dispo :( Usefull class for dealing with hot configuration of log4J. this is temporary we must find a way to abstract this layer.

the class offers three public static methods :

addSimulationAppender(String, String, String, String, String, String) to add a logger for a given simulation in a given thread, with simulLogLevel, scriptLogLvel and libLogLevel given.

removeAppender(String, String) to remove a appender of a simulation

showSimulationLogConsole(String) to display the log console of a simulation, given his name.

Author:
chemit

Field Summary
static String LOG_PATTERN
          pattern to use for simulation appender
 
Constructor Summary
SimulationLoggerUtil()
           
 
Method Summary
static void addSimulationAppender(String filename, String appenderId, String simulLogLevel, String scriptLogLevel, String libLogLevel, String threadName)
          Add a simple FileAppender for a given simulation id.
static void removeSimulationAppender(String appenderId)
          Remove the appender used for simulation, add restore level to logger.
static void showSimulationLogConsole(String simulationName)
          Open a new log console for the given simulation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_PATTERN

public static final String LOG_PATTERN
pattern to use for simulation appender

See Also:
Constant Field Values
Constructor Detail

SimulationLoggerUtil

public SimulationLoggerUtil()
Method Detail

addSimulationAppender

public static void addSimulationAppender(String filename,
                                         String appenderId,
                                         String simulLogLevel,
                                         String scriptLogLevel,
                                         String libLogLevel,
                                         String threadName)
                                  throws IsisFishException
Add a simple FileAppender for a given simulation id.

Parameters:
filename - the filename where appender store logs
appenderId - the id of appender to add
simulLogLevel - simulator logger level
libLogLevel - libraries logger level
scriptLogLevel - scripts logger level
threadName - the thread to exclude (if null don't use it)
Throws:
IsisFishException - if we could not create appender

removeSimulationAppender

public static void removeSimulationAppender(String appenderId)
Remove the appender used for simulation, add restore level to logger.

Parameters:
appenderId - the appender id to remove

showSimulationLogConsole

public static void showSimulationLogConsole(String simulationName)
                                     throws Exception
Open a new log console for the given simulation

Parameters:
simulationName - name of the simulation to use
Throws:
Exception - todo


Copyright © 1999-2010 CodeLutin. All Rights Reserved.