com.partnersoft.update.app
Class UpdateLog

java.lang.Object
  extended by com.partnersoft.update.app.UpdateLog

public class UpdateLog
extends java.lang.Object

A minimal replacement for the log4j framework.

This is a singleton instance. All references must be acquired from the singleton() class method.

Bootstrapping requires calling startLogFile(File) once you know where the file will go. Generally this should be logs/update.log in the destination filesystem. This should usually only be done once; if it is called more than once it will close and reopen using the provided file. This should allow you to make multiple update calls in the same JVM instance.

Log messages are also written to STDOUT so that they can be seen in the java or Java Web Start terminal.

Copyright 2005-2010 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Constructor Summary
UpdateLog()
           
 
Method Summary
 void append(java.lang.String type, java.lang.String message)
           
 void append(java.lang.String type, java.lang.String message, java.lang.Throwable oopsie)
           
 void error(java.lang.String message)
           
 void error(java.lang.String message, java.lang.Throwable oopsie)
           
 void fatal(java.lang.String message)
           
 void fatal(java.lang.String message, java.lang.Throwable oopsie)
           
 void info(java.lang.String message)
           
 void info(java.lang.String message, java.lang.Throwable oopsie)
           
 void logOutput(java.lang.Process proc)
          Logs all output from the given process.
 void setDefaultHandler()
          This only works under Java 1.5 and above.
static UpdateLog singleton()
           
 void startLogFile(java.io.File file)
           
 void warn(java.lang.String message)
           
 void warn(java.lang.String message, java.lang.Throwable oopsie)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateLog

public UpdateLog()
Method Detail

singleton

public static UpdateLog singleton()

startLogFile

public void startLogFile(java.io.File file)
                  throws java.io.IOException
Throws:
java.io.IOException

info

public void info(java.lang.String message)

info

public void info(java.lang.String message,
                 java.lang.Throwable oopsie)

warn

public void warn(java.lang.String message)

warn

public void warn(java.lang.String message,
                 java.lang.Throwable oopsie)

error

public void error(java.lang.String message)

error

public void error(java.lang.String message,
                  java.lang.Throwable oopsie)

fatal

public void fatal(java.lang.String message)

fatal

public void fatal(java.lang.String message,
                  java.lang.Throwable oopsie)

append

public void append(java.lang.String type,
                   java.lang.String message)

append

public void append(java.lang.String type,
                   java.lang.String message,
                   java.lang.Throwable oopsie)

setDefaultHandler

public void setDefaultHandler()
This only works under Java 1.5 and above. It's set up to (hopefully) fail gracefully if it won't work. You should only call this if you're running directly from the command line, Java Web Start, or similar non-standard (for Partner) bootstrap procedure.


logOutput

public void logOutput(java.lang.Process proc)
Logs all output from the given process. Use this when launching external commands.