intarsys runtime library

de.intarsys.tools.logging
Class LogTools

java.lang.Object
  extended by de.intarsys.tools.logging.LogTools

public class LogTools
extends Object

Tool methods to ease life with java.util.logging.


Field Summary
static String INDENT
           
 
Method Summary
static void closeFileLogger(Logger logger)
          Closes a fileLogger.
static Logger createFileLogger(String id, String filePattern, boolean append)
          Creates a fileLogger.
static List<String> dumpObject(String prefix, Object object)
           
static List<String> dumpObject(String prefix, Object object, IDumpObject details)
           
static Logger getLogger(Class<?> clazz)
          Get a logger that corresponds to clazz.
static Logger getLogger(String name)
          Get a logger for name name.
static String toLoggerName(Class<?> clazz)
          The name we want to use for a logger used in clazz.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INDENT

public static final String INDENT
See Also:
Constant Field Values
Method Detail

closeFileLogger

public static void closeFileLogger(Logger logger)
Closes a fileLogger.


createFileLogger

public static Logger createFileLogger(String id,
                                      String filePattern,
                                      boolean append)
                               throws SecurityException,
                                      IOException
Creates a fileLogger.

Returns:
A Logger named with 'id'.
Throws:
IOException
SecurityException

dumpObject

public static List<String> dumpObject(String prefix,
                                      Object object)

dumpObject

public static List<String> dumpObject(String prefix,
                                      Object object,
                                      IDumpObject details)

getLogger

public static Logger getLogger(Class<?> clazz)
Get a logger that corresponds to clazz.

Parameters:
clazz - The class object we want a logger for.
Returns:
A Logger that corresponds to clazz.

getLogger

public static Logger getLogger(String name)
Get a logger for name name.

Parameters:
name - The logger name/category
Returns:
Get a logger for name name.

toLoggerName

public static String toLoggerName(Class<?> clazz)
The name we want to use for a logger used in clazz. This implementation uses the package name.

Parameters:
clazz - The class object we want a name for.
Returns:
The name we want to use for a logger used in clazz.

intarsys runtime library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.