com.sun.enterprise.server.logging
Class GFFileHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by java.util.logging.StreamHandler
          extended by com.sun.enterprise.server.logging.GFFileHandler
All Implemented Interfaces:
org.jvnet.hk2.component.PostConstruct, org.jvnet.hk2.component.PreDestroy

@Service
@Scoped(value=org.jvnet.hk2.component.Singleton.class)
public class GFFileHandler
extends java.util.logging.StreamHandler
implements org.jvnet.hk2.component.PostConstruct, org.jvnet.hk2.component.PreDestroy

GFFileHandler publishes formatted log Messages to a FILE.


Constructor Summary
GFFileHandler()
           
 
Method Summary
 void cleanUpHistoryLogFiles()
          cleanup the history log file based on attributes set under logging.properties file".
 java.io.File getCurrentLogFile()
          A simple getter to access the current log file written by this FileHandler.
protected  java.io.File getLogFileName()
           
 void log()
          5005 Retrieves the LogRecord from our Queue and store them in the file
 void postConstruct()
           
 void preDestroy()
           
 void publish(java.util.logging.LogRecord record)
          Publishes the logrecord storing it in our queue
 void rotate()
          A Simple rotate method to close the old file and start the new one when the limit is reached.
 
Methods inherited from class java.util.logging.StreamHandler
close, flush, isLoggable, setEncoding, setOutputStream
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, reportError, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GFFileHandler

public GFFileHandler()
Method Detail

postConstruct

public void postConstruct()
Specified by:
postConstruct in interface org.jvnet.hk2.component.PostConstruct

preDestroy

public void preDestroy()
Specified by:
preDestroy in interface org.jvnet.hk2.component.PreDestroy

getCurrentLogFile

public java.io.File getCurrentLogFile()
A simple getter to access the current log file written by this FileHandler.


cleanUpHistoryLogFiles

public void cleanUpHistoryLogFiles()
cleanup the history log file based on attributes set under logging.properties file".

If it is defined with valid number, we only keep that number of history logfiles; If "max_history_files" is defined without value, then default that number to be 10; If "max_history_files" is defined with value 0, any number of history files are kept.


rotate

public void rotate()
A Simple rotate method to close the old file and start the new one when the limit is reached.


log

public void log()
5005 Retrieves the LogRecord from our Queue and store them in the file


publish

public void publish(java.util.logging.LogRecord record)
Publishes the logrecord storing it in our queue

Overrides:
publish in class java.util.logging.StreamHandler

getLogFileName

protected java.io.File getLogFileName()


Copyright © 2012 GlassFish Community. All Rights Reserved.