org.jnetpcap.util
Class JLogger

java.lang.Object
  extended by java.util.logging.Logger
      extended by org.jnetpcap.util.JLogger

public class JLogger
extends java.util.logging.Logger

Java Logging mechanism. This is a slight extension to JRE's logger that initializes the global logging environmet and adds a couple of convenience methods that are jNetPcap specific. Default jNetPcap properties are loaded as a resource found in CLASSPATH under the resources directory.

Note: standard system properties for JRE's logging system:

 "java.util.logging.config.file" - specifies a .properties file
 "java.util.logging.config.class" - a class configures the LogManager from its 
    constructor
 

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Field Summary
static java.lang.String PROPERTIES_CONFIG
          Default resource file with logger configurations.
 
Fields inherited from class java.util.logging.Logger
global, GLOBAL_LOGGER_NAME
 
Constructor Summary
JLogger(java.lang.String name, java.lang.String resourceBundleName)
          Instantiates a new j logger.
 
Method Summary
static java.util.logging.Logger getLogger(java.lang.Class<?> c)
          Gets the logger.
static java.util.logging.Logger getLogger(java.lang.Package p)
          Gets the logger.
static java.util.logging.LogManager readConfiguration(java.util.Properties properties)
          Read configuration.
 void setLevel(java.util.logging.Level newLevel)
          Sets the level.
 
Methods inherited from class java.util.logging.Logger
addHandler, config, entering, entering, entering, exiting, exiting, fine, finer, finest, getAnonymousLogger, getAnonymousLogger, getFilter, getHandlers, getLevel, getLogger, getLogger, getName, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, info, isLoggable, log, log, log, log, log, logp, logp, logp, logp, logrb, logrb, logrb, logrb, removeHandler, setFilter, setParent, setUseParentHandlers, severe, throwing, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTIES_CONFIG

public static final java.lang.String PROPERTIES_CONFIG
Default resource file with logger configurations.

See Also:
Constant Field Values
Constructor Detail

JLogger

public JLogger(java.lang.String name,
               java.lang.String resourceBundleName)
Instantiates a new j logger.

Parameters:
name - the name
resourceBundleName - the resource bundle name
Method Detail

getLogger

public static java.util.logging.Logger getLogger(java.lang.Class<?> c)
Gets the logger.

Parameters:
c - the c
Returns:
the logger

getLogger

public static java.util.logging.Logger getLogger(java.lang.Package p)
Gets the logger.

Parameters:
p - the p
Returns:
the logger

readConfiguration

public static java.util.logging.LogManager readConfiguration(java.util.Properties properties)
                                                      throws java.lang.SecurityException,
                                                             java.io.IOException
Read configuration.

Parameters:
properties - the properties
Returns:
the log manager
Throws:
java.lang.SecurityException - the security exception
java.io.IOException - Signals that an I/O exception has occurred.

setLevel

public void setLevel(java.util.logging.Level newLevel)
              throws java.lang.SecurityException
Sets the level.

Overrides:
setLevel in class java.util.logging.Logger
Parameters:
newLevel - the new level
Throws:
java.lang.SecurityException - the security exception
See Also:
Logger.setLevel(java.util.logging.Level)