ElegantJCharts Java API Specification v2.0

com.elegantj.common
Class ErrorLog

java.lang.Object
  |
  +--com.elegantj.common.ErrorLog

public class ErrorLog
extends java.lang.Object

ErrorLog writes the the errors in the Error Log File.
Each error has the following attributes.
(1) Error occurrence time
(2) Connection host name (IP address)
(3) Error information
·Error type (operation error / application error / DB error)
·Probable cause message
·SQL code
·SQL message
·Java stack trace


Field Summary
static int APPLICATION_ERROR
          Specifies the error type constant
static int DATABASE_ERROR
          Specifies the error type constant
static int OPERATION_ERROR
          Specifies the error type constant
 
Constructor Summary
ErrorLog()
           
 
Method Summary
static java.io.PrintStream getErrorStream()
          Gets ErrorStrem
static java.lang.String getMessage(java.lang.Throwable t)
          Returns the message of root exception
static void printApplicationError(java.lang.Throwable t)
          Sets Application error
static void printApplicationError(java.lang.Throwable t, java.lang.String message)
          Sets Application error
static void printDatabaseError(java.lang.Throwable t, int sqlCode, java.lang.String sqlMessage)
          Sets Database error
static void printDatabaseError(java.lang.Throwable t, java.lang.String message, int sqlCode, java.lang.String sqlMessage)
          Sets Database error
static void printError(java.lang.Throwable t)
          Print error to output stream
static void printError(java.lang.Throwable t, int type)
          Print error to output stream
static void printError(java.lang.Throwable t, int type, int sqlCode, java.lang.String sqlMessage)
          Print error to output stream
static void printError(java.lang.Throwable t, int type, java.lang.String message)
          Print error to output stream
static void printError(java.lang.Throwable t, int type, java.lang.String message, int sqlCode, java.lang.String sqlMessage)
          Print error to output stream
static void printError(java.lang.Throwable t, java.lang.String message)
          Print error to output stream
static void printMessage(java.lang.Object message)
          print message to ouput stream
static void printMessage(java.lang.String message)
          print message to ouput stream
static void printOperationError(java.lang.Throwable t)
          Sets Operation error
static void printOperationError(java.lang.Throwable t, java.lang.String message)
          Sets Operation error
static void setErrorStream(java.io.PrintStream errorStream)
          Sets ErrorStrem object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPERATION_ERROR

public static final int OPERATION_ERROR
Specifies the error type constant

See Also:
Constant Field Values

APPLICATION_ERROR

public static final int APPLICATION_ERROR
Specifies the error type constant

See Also:
Constant Field Values

DATABASE_ERROR

public static final int DATABASE_ERROR
Specifies the error type constant

See Also:
Constant Field Values
Constructor Detail

ErrorLog

public ErrorLog()
Method Detail

setErrorStream

public static void setErrorStream(java.io.PrintStream errorStream)
Sets ErrorStrem object

Parameters:
errorStream - printStream object, error will be outputed on this stream

getErrorStream

public static java.io.PrintStream getErrorStream()
Gets ErrorStrem

Returns:
PrintStream printStream object

printOperationError

public static void printOperationError(java.lang.Throwable t)
Sets Operation error

Parameters:
t - Throwable object. It contains error description

printOperationError

public static void printOperationError(java.lang.Throwable t,
                                       java.lang.String message)
Sets Operation error

Parameters:
t - Throwable object. It contains error description.
message - error message

printApplicationError

public static void printApplicationError(java.lang.Throwable t)
Sets Application error

Parameters:
t - Throwable object. It contains error description

printApplicationError

public static void printApplicationError(java.lang.Throwable t,
                                         java.lang.String message)
Sets Application error

Parameters:
t - Throwable object. It contains error description
message - error message

printDatabaseError

public static void printDatabaseError(java.lang.Throwable t,
                                      int sqlCode,
                                      java.lang.String sqlMessage)
Sets Database error

Parameters:
t - Throwable object. It contains error description
sqlCode - sql code
sqlMessage - sql message

printDatabaseError

public static void printDatabaseError(java.lang.Throwable t,
                                      java.lang.String message,
                                      int sqlCode,
                                      java.lang.String sqlMessage)
Sets Database error

Parameters:
t - Throwable object. It contains error description
sqlCode - sql code
sqlMessage - sql message
message - message string

printError

public static void printError(java.lang.Throwable t)
Print error to output stream

Parameters:
t - Throwable object. It contains error description

printError

public static void printError(java.lang.Throwable t,
                              int type)
Print error to output stream

Parameters:
t - Throwable object. It contains error description
type - type of error

printError

public static void printError(java.lang.Throwable t,
                              java.lang.String message)
Print error to output stream

Parameters:
t - Throwable object. It contains error description
message - message string

printError

public static void printError(java.lang.Throwable t,
                              int type,
                              java.lang.String message)
Print error to output stream

Parameters:
t - Throwable object. It contains error description
type - error type
message - message string

printError

public static void printError(java.lang.Throwable t,
                              int type,
                              int sqlCode,
                              java.lang.String sqlMessage)
Print error to output stream

Parameters:
t - Throwable object. It contains error description
type - error type
sqlMessage - sql message

printError

public static void printError(java.lang.Throwable t,
                              int type,
                              java.lang.String message,
                              int sqlCode,
                              java.lang.String sqlMessage)
Print error to output stream

Parameters:
t - Throwable object. It contains error description
type - error type
sqlCode - sql Code
sqlMessage - sql message
message - message string

printMessage

public static void printMessage(java.lang.Object message)
print message to ouput stream

Parameters:
message - message string

printMessage

public static void printMessage(java.lang.String message)
print message to ouput stream

Parameters:
message - message string

getMessage

public static java.lang.String getMessage(java.lang.Throwable t)
Returns the message of root exception


ElegantJCharts Java API Specification v2.0

For any feedback, suggestion, or query, please revert back to support@elegantcharts.com

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjcharts.com
All Rights Reserved.