@Service
@Singleton
@ContractsProvided(value={GFFileHandler.class,java.util.logging.Handler.class,LogEventBroadcaster.class,LoggingRuntime.class})
public class GFFileHandler
extends StreamHandler
implements org.glassfish.hk2.api.PostConstruct, org.glassfish.hk2.api.PreDestroy, LogEventBroadcaster, LoggingRuntime
| Modifier and Type | Field and Description |
|---|---|
static int |
DISABLE_LOG_FILE_ROTATION_VALUE |
protected ServerEnvironmentImpl |
env |
protected static String |
LOGS_DIR |
static int |
MINIMUM_ROTATION_LIMIT_VALUE |
| Constructor and Description |
|---|
GFFileHandler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addLogEventListener(LogEventListener listener) |
void |
cleanUpHistoryLogFiles()
cleanup the history log file based on attributes set under logging.properties file".
|
protected String |
evaluateFileName() |
File |
getCurrentLogFile()
A simple getter to access the current log file written by
this FileHandler.
|
protected File |
getLogFileName() |
void |
informLogEventListeners(LogEvent logEvent)
Broadcast the log event to registered listeners.
|
void |
log()
5005
Retrieves the LogRecord from our Queue and store them in the file
|
void |
postConstruct() |
void |
preDestroy() |
void |
publish(LogRecord record)
Publishes the logrecord storing it in our queue
|
boolean |
removeLogEventListener(LogEventListener listener) |
void |
rotate()
A Simple rotate method to close the old file and start the new one
when the limit is reached.
|
close, flush, isLoggable, setEncoding, setOutputStreamgetEncoding, getErrorManager, getFilter, getFormatter, getLevel, reportError, setErrorManager, setFilter, setFormatter, setLevelpublic static final int DISABLE_LOG_FILE_ROTATION_VALUE
@Inject protected ServerEnvironmentImpl env
protected static final String LOGS_DIR
public static final int MINIMUM_ROTATION_LIMIT_VALUE
public void postConstruct()
postConstruct in interface org.glassfish.hk2.api.PostConstructprotected String evaluateFileName()
public void preDestroy()
preDestroy in interface org.glassfish.hk2.api.PreDestroypublic File getCurrentLogFile()
getCurrentLogFile in interface LoggingRuntimepublic void cleanUpHistoryLogFiles()
public void rotate()
public void log()
public void publish(LogRecord record)
publish in class StreamHandlerprotected File getLogFileName()
public boolean addLogEventListener(LogEventListener listener)
public boolean removeLogEventListener(LogEventListener listener)
public void informLogEventListeners(LogEvent logEvent)
LogEventBroadcasterinformLogEventListeners in interface LogEventBroadcasterCopyright © 2017. All rights reserved.