intarsys runtime library

de.intarsys.tools.logging
Class FileDumpHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by de.intarsys.tools.logging.FileDumpHandler

public class FileDumpHandler
extends Handler

A java logging Handler that checks for parameters that come along with the log record that should be "dumped" in a directory. Simple set up the FileDumpHandler and write code like

 ...
 Log.log(Level.INFO, "input data", myFile);
 ...
 
This result in "myFile" content copied to the file dump directory.

This implementation supports parameters of type


Constructor Summary
FileDumpHandler()
           
 
Method Summary
 void close()
           
static void dump(File logDir, Object target)
           
 void flush()
           
 File getDirectory()
           
 void publish(LogRecord record)
           
 void setDirectory(File directory)
           
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileDumpHandler

public FileDumpHandler()
Method Detail

dump

public static void dump(File logDir,
                        Object target)
                 throws IOException,
                        FileNotFoundException
Throws:
IOException
FileNotFoundException

close

public void close()
           throws SecurityException
Specified by:
close in class Handler
Throws:
SecurityException

flush

public void flush()
Specified by:
flush in class Handler

getDirectory

public File getDirectory()

publish

public void publish(LogRecord record)
Specified by:
publish in class Handler

setDirectory

public void setDirectory(File directory)

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.