PAJES 2.3.9

org.pajes.util
Class Trace

java.lang.Object
  extended byorg.pajes.util.Trace

public class Trace
extends java.lang.Object

The PAJES tracing facility.

Tracing can be turned on:


Field Summary
static int ACCESS
          Security messages [2]
static int DEBUG
          Debug messages [6]
static int ERROR
          Error messages [0]
static int IGNORED
          Ignored Exceptions [5]
static int INFORMATION
          Information messages [4]
static int PAJES
          PAJES trace messages [7]
static int PAJES_DB
          PAJES Database objects trace messages [9]
static int PAJES_PARSER
          PAJES parsing trace messages [8]
static int STATISTICS
          Performance statitics messages [3]
static int WARNING
          Warning messages [1]
 
Method Summary
static boolean getIncludePajesSource()
          Returns whether the PAJES classes will be reported in the source stack trace.
static boolean getIncludeThreadName()
          Returns whether the Thread name will be reported.
static boolean getShowHeapSize()
          Returns whether the heap size will be reported.
static int getSourceDepth()
          Returns the depth to which the source of the trace message will be reported.
static java.lang.String getStacktrace(java.lang.Throwable throwable)
          Returns a stack trace as a String.
static void getStacktrace(java.lang.Throwable throwable, java.io.PrintWriter writer)
          Writes the throwable stack trace to the specified Writer.
static boolean getSuppressLineFeeds()
          Determines whether or not line feeds are suppressed in messages.
static boolean isOn(int severity)
          Determines if logging is turned on for the specified severity level.
static void log(int severity, java.lang.Object o0)
          Logs a trace message consisting of the specifed object.
static void log(int severity, java.lang.Object o0, java.lang.Object o1)
          Logs a trace message consisting of the concatenated parameter objects.
static void log(int severity, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2)
          Logs a trace message consisting of the concatenated parameter objects.
static void log(int severity, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3)
          Logs a trace message consisting of the concatenated parameter objects.
static void log(int severity, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4)
          Logs a trace message consisting of the concatenated parameter objects.
static void log(int severity, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4, java.lang.Object o5)
          Logs a trace message consisting of the concatenated parameter objects.
static void log(int severity, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4, java.lang.Object o5, java.lang.Object o6)
          Logs a trace message consisting of the concatenated parameter objects.
static void log(int severity, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4, java.lang.Object o5, java.lang.Object o6, java.lang.Object o7)
          Logs a trace message consisting of the concatenated parameter objects.
static void log(int severity, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4, java.lang.Object o5, java.lang.Object o6, java.lang.Object o7, java.lang.Object o8)
          Logs a trace message consisting of the concatenated parameter objects.
static void log(int severity, java.lang.Object o0, java.lang.Object o1, java.lang.Object o2, java.lang.Object o3, java.lang.Object o4, java.lang.Object o5, java.lang.Object o6, java.lang.Object o7, java.lang.Object o8, java.lang.Object o9)
          Logs a trace message consisting of the concatenated parameter objects.
static void setFlag(int severity, boolean on)
          Turns logging on or off for the specified severity level.
static void setFlags(int severity, boolean on)
          Turns logging on or off for the specified severity level, and all levels BELOW it.
static void setIncludePajesSource(boolean on)
          Determines whether the PAJES classes will be reported in the source stack trace.
static void setIncludeThreadName(boolean on)
          Sets whether the Thread name will be reported.
static void setServletContext(javax.servlet.ServletContext logContext)
          Sets the servlet context to which messages will be logged.
static void setShowHeapSize(boolean on)
          Sets whether the heap size will be reported.
static void setSourceDepth(int depth)
          Sets the depth to which the source of the trace message will be reported.
static void setSuppressLineFeeds(boolean b)
          Sets whether or not line feeds are suppressed in messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final int ERROR
Error messages [0]

See Also:
Constant Field Values

WARNING

public static final int WARNING
Warning messages [1]

See Also:
Constant Field Values

ACCESS

public static final int ACCESS
Security messages [2]

See Also:
Constant Field Values

STATISTICS

public static final int STATISTICS
Performance statitics messages [3]

See Also:
Constant Field Values

INFORMATION

public static final int INFORMATION
Information messages [4]

See Also:
Constant Field Values

IGNORED

public static final int IGNORED
Ignored Exceptions [5]

See Also:
Constant Field Values

DEBUG

public static final int DEBUG
Debug messages [6]

See Also:
Constant Field Values

PAJES

public static final int PAJES
PAJES trace messages [7]

See Also:
Constant Field Values

PAJES_PARSER

public static final int PAJES_PARSER
PAJES parsing trace messages [8]

See Also:
Constant Field Values

PAJES_DB

public static final int PAJES_DB
PAJES Database objects trace messages [9]

See Also:
Constant Field Values
Method Detail

setFlag

public static void setFlag(int severity,
                           boolean on)
Turns logging on or off for the specified severity level. Note that logging will only occur if the ServletContext destination has been set.

Parameters:
severity - one of the defined severity contants.
on - true if logging is to be turned on for the specified severity level, or false if it is to be turned off.

setFlags

public static void setFlags(int severity,
                            boolean on)
Turns logging on or off for the specified severity level, and all levels BELOW it. Note that logging will only occur if the ServletContext destination has been set.

Parameters:
severity - one of the defined severity contants.
on - true if logging is to be turned on for the specified severity levels, or false if it is to be turned off.

setIncludePajesSource

public static void setIncludePajesSource(boolean on)
Determines whether the PAJES classes will be reported in the source stack trace. The default is false.

The context default can be changed by creating a <context-param> with a <param-name> of org.pajes.util.Trace.setIncludePajesSource, and a <param-value> of true. For example:

 
    <context-param>
        <param-name>org.pajes.util.Trace.setIncludePajesSource</param-name>
        <param-value>true</param-value>
    </context-param>
  
 

Parameters:
on - true if the PAJES classes are to be reported in the source stack trace.

getIncludePajesSource

public static boolean getIncludePajesSource()
Returns whether the PAJES classes will be reported in the source stack trace.

Returns:
true if the PAJES classes are to be reported in the source stack trace.

setIncludeThreadName

public static void setIncludeThreadName(boolean on)
Sets whether the Thread name will be reported. The default is false.

The context default can be changed by creating a <context-param> with a <param-name> of org.pajes.util.Trace.setIncludeThreadName, and a <param-value> of true. For example:

 
    <context-param>
        <param-name>org.pajes.util.Trace.setIncludeThreadName</param-name>
        <param-value>true</param-value>
    </context-param>
  
 

Parameters:
on - true to include the Thread name in the message.

getIncludeThreadName

public static boolean getIncludeThreadName()
Returns whether the Thread name will be reported.

Returns:
true if the message will include the Thread name.

isOn

public static boolean isOn(int severity)
Determines if logging is turned on for the specified severity level.

Parameters:
severity - one of the defined severity contants.
Returns:
true if logging is turned on for the specified severity level, or false if it is not.

setServletContext

public static void setServletContext(javax.servlet.ServletContext logContext)
Sets the servlet context to which messages will be logged.

Parameters:
logContext - the ServletContext to which messages are to be logged. Set to null to disable logging.

setShowHeapSize

public static void setShowHeapSize(boolean on)
Sets whether the heap size will be reported. The default is false.

The context default can be changed by creating a <context-param> with a <param-name> of org.pajes.util.Trace.setShowHeapSize, and a <param-value> of true. For example:

 
    <context-param>
        <param-name>org.pajes.util.Trace.setShowHeapSize</param-name>
        <param-value>true</param-value>
    </context-param>
  
 

Parameters:
on - true to include the heap size in the message.

getShowHeapSize

public static boolean getShowHeapSize()
Returns whether the heap size will be reported.

Returns:
true if the message will include the heap size.

setSourceDepth

public static void setSourceDepth(int depth)
Sets the depth to which the source of the trace message will be reported. The default is 1. Use 0 to report the full stack trace.

The context default can be changed by creating a <context-param> with a <param-name> of org.pajes.util.Trace.setSourceDepth, and a <param-value> of the required depth. For example:

 
    <context-param>
        <param-name>org.pajes.util.Trace.setSourceDepth</param-name>
        <param-value>0</param-value>
    </context-param>
  
 

Parameters:
depth - the depth of the stack trace.

getSourceDepth

public static int getSourceDepth()
Returns the depth to which the source of the trace message will be reported.

Returns:
the depth of the stack trace.

getStacktrace

public static java.lang.String getStacktrace(java.lang.Throwable throwable)
Returns a stack trace as a String.

Parameters:
throwable - the Throwable instance for which the stack trace is required.
Returns:
The stack trace.

getStacktrace

public static void getStacktrace(java.lang.Throwable throwable,
                                 java.io.PrintWriter writer)
Writes the throwable stack trace to the specified Writer. If there are any nested exceptions, the chain is followed until it is exhausted.

Parameters:
throwable - the Throwable instance for which the stack trace is required.
writer - the Writer to which the stack trace will be written.

setSuppressLineFeeds

public static void setSuppressLineFeeds(boolean b)
Sets whether or not line feeds are suppressed in messages.

Parameters:
b - true if line feeds are suppresed.

getSuppressLineFeeds

public static boolean getSuppressLineFeeds()
Determines whether or not line feeds are suppressed in messages.

Returns:
true if line feeds are suppresed.

log

public static void log(int severity,
                       java.lang.Object o0)
Logs a trace message consisting of the specifed object.

Parameters:
severity - one of the defined severity contants to indicate the severity level at which this message should be logged.
o0 - an Object to be logged

log

public static void log(int severity,
                       java.lang.Object o0,
                       java.lang.Object o1)
Logs a trace message consisting of the concatenated parameter objects. Each object will be separated from the preceding object by a single space.

Parameters:
severity - one of the defined severity contants to indicate the severity level at which this message should be logged.
o0 - an Object to be logged
o1 - an Object to be logged

log

public static void log(int severity,
                       java.lang.Object o0,
                       java.lang.Object o1,
                       java.lang.Object o2)
Logs a trace message consisting of the concatenated parameter objects. Each object will be separated from the preceding object by a single space.

Parameters:
severity - one of the defined severity contants to indicate the severity level at which this message should be logged.
o0 - an Object to be logged
o1 - an Object to be logged
o2 - an Object to be logged

log

public static void log(int severity,
                       java.lang.Object o0,
                       java.lang.Object o1,
                       java.lang.Object o2,
                       java.lang.Object o3)
Logs a trace message consisting of the concatenated parameter objects. Each object will be separated from the preceding object by a single space.

Parameters:
severity - one of the defined severity contants to indicate the severity level at which this message should be logged.
o0 - an Object to be logged
o1 - an Object to be logged
o2 - an Object to be logged
o3 - an Object to be logged

log

public static void log(int severity,
                       java.lang.Object o0,
                       java.lang.Object o1,
                       java.lang.Object o2,
                       java.lang.Object o3,
                       java.lang.Object o4)
Logs a trace message consisting of the concatenated parameter objects. Each object will be separated from the preceding object by a single space.

Parameters:
severity - one of the defined severity contants to indicate the severity level at which this message should be logged.
o0 - an Object to be logged
o1 - an Object to be logged
o2 - an Object to be logged
o3 - an Object to be logged
o4 - an Object to be logged

log

public static void log(int severity,
                       java.lang.Object o0,
                       java.lang.Object o1,
                       java.lang.Object o2,
                       java.lang.Object o3,
                       java.lang.Object o4,
                       java.lang.Object o5)
Logs a trace message consisting of the concatenated parameter objects. Each object will be separated from the preceding object by a single space.

Parameters:
severity - one of the defined severity contants to indicate the severity level at which this message should be logged.
o0 - an Object to be logged
o1 - an Object to be logged
o2 - an Object to be logged
o3 - an Object to be logged
o4 - an Object to be logged
o5 - an Object to be logged

log

public static void log(int severity,
                       java.lang.Object o0,
                       java.lang.Object o1,
                       java.lang.Object o2,
                       java.lang.Object o3,
                       java.lang.Object o4,
                       java.lang.Object o5,
                       java.lang.Object o6)
Logs a trace message consisting of the concatenated parameter objects. Each object will be separated from the preceding object by a single space.

Parameters:
severity - one of the defined severity contants to indicate the severity level at which this message should be logged.
o0 - an Object to be logged
o1 - an Object to be logged
o2 - an Object to be logged
o3 - an Object to be logged
o4 - an Object to be logged
o5 - an Object to be logged
o6 - an Object to be logged

log

public static void log(int severity,
                       java.lang.Object o0,
                       java.lang.Object o1,
                       java.lang.Object o2,
                       java.lang.Object o3,
                       java.lang.Object o4,
                       java.lang.Object o5,
                       java.lang.Object o6,
                       java.lang.Object o7)
Logs a trace message consisting of the concatenated parameter objects. Each object will be separated from the preceding object by a single space.

Parameters:
severity - one of the defined severity contants to indicate the severity level at which this message should be logged.
o0 - an Object to be logged
o1 - an Object to be logged
o2 - an Object to be logged
o3 - an Object to be logged
o4 - an Object to be logged
o5 - an Object to be logged
o6 - an Object to be logged
o7 - an Object to be logged

log

public static void log(int severity,
                       java.lang.Object o0,
                       java.lang.Object o1,
                       java.lang.Object o2,
                       java.lang.Object o3,
                       java.lang.Object o4,
                       java.lang.Object o5,
                       java.lang.Object o6,
                       java.lang.Object o7,
                       java.lang.Object o8)
Logs a trace message consisting of the concatenated parameter objects. Each object will be separated from the preceding object by a single space.

Parameters:
severity - one of the defined severity contants to indicate the severity level at which this message should be logged.
o0 - an Object to be logged
o1 - an Object to be logged
o2 - an Object to be logged
o3 - an Object to be logged
o4 - an Object to be logged
o5 - an Object to be logged
o6 - an Object to be logged
o7 - an Object to be logged
o8 - an Object to be logged

log

public static void log(int severity,
                       java.lang.Object o0,
                       java.lang.Object o1,
                       java.lang.Object o2,
                       java.lang.Object o3,
                       java.lang.Object o4,
                       java.lang.Object o5,
                       java.lang.Object o6,
                       java.lang.Object o7,
                       java.lang.Object o8,
                       java.lang.Object o9)
Logs a trace message consisting of the concatenated parameter objects. Each object will be separated from the preceding object by a single space.

Parameters:
severity - one of the defined severity contants to indicate the severity level at which this message should be logged.
o0 - an Object to be logged
o1 - an Object to be logged
o2 - an Object to be logged
o3 - an Object to be logged
o4 - an Object to be logged
o5 - an Object to be logged
o6 - an Object to be logged
o7 - an Object to be logged
o8 - an Object to be logged
o9 - an Object to be logged

PAJES 2.3.9

Copyright © 2002-2003 Viridian Pty Limited. All Rights Reserved.