com.arsdigita.logging
Class ErrorReport

java.lang.Object
  extended bycom.arsdigita.logging.ErrorReport
Direct Known Subclasses:
InitializerErrorReport, ServletErrorReport

public class ErrorReport
extends Object

Base class for handling error reports. Typical usage is: try { // something that goes wrong } catch (Exception ex) { ErrorReport report = new ErrorReport(ex); report.logit(); throw ex; }

Author:
Dan Berrange
See Also:
http://www.tuxedo.org/~esr/jargon/html/entry/guru-meditation.html

Field Summary
static String versionId
           
 
Constructor Summary
ErrorReport(Throwable throwable)
           
 
Method Summary
 void addSection(String name, Collection lines)
           
 void addSection(String name, String line)
           
 void addSection(String name, String[] lines)
           
 String getGuruMeditationCode()
          Returns the globally unique error code for this error report.
 String getHostname()
           
 String getReport()
           
static void initializeAppender(String directory)
           
 void logit()
          Writes a nicely formatted error report into the log file.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

ErrorReport

public ErrorReport(Throwable throwable)
Method Detail

initializeAppender

public static void initializeAppender(String directory)

getHostname

public String getHostname()

getGuruMeditationCode

public String getGuruMeditationCode()
Returns the globally unique error code for this error report. This can be used to identity the entry in the log files upon recieving feedback from the end user.


addSection

public void addSection(String name,
                       Collection lines)

addSection

public void addSection(String name,
                       String[] lines)

addSection

public void addSection(String name,
                       String line)

getReport

public String getReport()

toString

public String toString()

logit

public void logit()
Writes a nicely formatted error report into the log file.



Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC