java.lang.Object
java.util.logging.Handler
org.glassfish.main.jul.handler.GlassFishLogHandler
- All Implemented Interfaces:
ExternallyManagedLogHandler
GlassFish log handler
- can redirect output going through STDOUT and STDERR
- buffers log records
- Author:
- David Matejcek, Jerome Dochez (original concepts of GFFileHandler), Carla Mott (original concepts of GFFileHandler)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()First stops all dependencies using this handler (changes status toGlassFishLogHandler.GlassFishLogHandlerStatus.OFF, then closes all resources managed by this handler and finally closes the output stream.createGlassFishLogHandlerConfiguration(Class<? extends GlassFishLogHandler> handlerClass) Creates the configuration object for this class or it's descendants.voidflush()booleanisLoggable(LogRecord record) booleanisReady()voidDoes not publish the record, but puts it into the queue buffer to be processed by an internal thread.voidreconfigure(GlassFishLogHandlerConfiguration newConfiguration) Reconfigures the handler: first cancels scheduled rotation of the output file, then stops the output.voidroll()Explicitly rolls the log file.toString()Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Constructor Details
-
GlassFishLogHandler
public GlassFishLogHandler() -
GlassFishLogHandler
-
-
Method Details
-
createGlassFishLogHandlerConfiguration
public static GlassFishLogHandlerConfiguration createGlassFishLogHandlerConfiguration(Class<? extends GlassFishLogHandler> handlerClass) Creates the configuration object for this class or it's descendants.- Parameters:
handlerClass-- Returns:
- the configuration parsed from the property file, usable to call
the
reconfigure(GlassFishLogHandlerConfiguration)method.
-
isReady
public boolean isReady()- Specified by:
isReadyin interfaceExternallyManagedLogHandler- Returns:
- true if the configuration is complete and the handler is capable to immediately start processing the data.
-
getConfiguration
- Returns:
- clone of the internal configuration
-
reconfigure
Reconfigures the handler: first cancels scheduled rotation of the output file, then stops the output. After that replaces the original configuration with the argument and starts the output again - if it fails, turns off completely including accepting new records and throws the exception.- Parameters:
newConfiguration-
-
publish
Does not publish the record, but puts it into the queue buffer to be processed by an internal thread. -
isLoggable
- Overrides:
isLoggablein classHandler
-
flush
public void flush() -
roll
public void roll()Explicitly rolls the log file. -
close
public void close()First stops all dependencies using this handler (changes status toGlassFishLogHandler.GlassFishLogHandlerStatus.OFF, then closes all resources managed by this handler and finally closes the output stream. -
toString
-