com.sun.sgs.impl.sharedutil.logging
Class ResamplingUrlLogConfiguration

java.lang.Object
  extended by com.sun.sgs.impl.sharedutil.logging.ResamplingUrlLogConfiguration

public class ResamplingUrlLogConfiguration
extends Object

Defines a class that allows the logging configuration to be specified by a URL and periodically rereads the configuration if it has changed.

This class recognizes the following LogManager configuration properties:

Property: "java.util.logging.config.file"
Default: file://localhost/${java.home}/lib/logging.properties
Specifies the URL for the logging configuration. The URL is parsed using the context file://localhost/, so the value will be parsed correctly as a file on the local host if specified with forward slashes.

Property: "com.sun.sgs.impl.sharedutil.logging.ResamplingUrlLogConfiguration.interval"
Default: 30000L
Specifies the interval in milliseconds between times that this class checks if the contents of the logging configuration URL have changed.

You can use this class by specifying its class name either as the value of the config logging property, or as the value of the java.util.logging.config.class system property, as documented by the LogManager class. You need to specify the system property if you want to use a URL for the logging configuration file.

For example, to use this class to check for changes to the configuration every 10 seconds, put the following text in the logging configuration file:

   .level=INFO
   handlers=java.util.logging.ConsoleHandler
   config=com.sun.sgs.impl.sharedutil.logging.ResamplingUrlLogConfiguration
   com.sun.sgs.impl.sharedutil.logging.ResamplingUrlLogConfiguration.interval=10000
 

To specify the location of the logging configuration file using the HTTP URL http://myhost/logging.config, put the following two system property settings on the command line:

   -Djava.util.logging.config.class=com.sun.sgs.impl.sharedutil.logging.ResamplingUrlLogConfiguration
   -Djava.util.logging.config.file=http://myhost/logging.config
 
This class uses the Logger named com.sun.sgs.impl.sharedutil.logging.ResamplingUrlLogConfiguration to log information at the following logging levels:


Field Summary
static String CONFIG_FILE_PROPERTY
          The property that specifies the configuration file.
static long RESAMPLE_INTERVAL_DEFAULT
          The default resample interval.
static String RESAMPLE_INTERVAL_PROPERTY
          The property that specifies the resample interval.
 
Constructor Summary
ResamplingUrlLogConfiguration()
          Creates an instance of this class.
 
Method Summary
protected  void init()
          Initialize this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_FILE_PROPERTY

public static final String CONFIG_FILE_PROPERTY
The property that specifies the configuration file.

See Also:
Constant Field Values

RESAMPLE_INTERVAL_PROPERTY

public static final String RESAMPLE_INTERVAL_PROPERTY
The property that specifies the resample interval.

See Also:
Constant Field Values

RESAMPLE_INTERVAL_DEFAULT

public static final long RESAMPLE_INTERVAL_DEFAULT
The default resample interval.

See Also:
Constant Field Values
Constructor Detail

ResamplingUrlLogConfiguration

public ResamplingUrlLogConfiguration()
Creates an instance of this class.

Method Detail

init

protected void init()
Initialize this class.


Project Darkstar, Version 0.9.9
2013-07-29 20:40:00

Copyright © 2007-2013 Sun Microsystems, Inc. All rights reserved