com.metamatrix.common.log
Class DbLogWriter

java.lang.Object
  extended by com.metamatrix.common.log.DbLogWriter

public class DbLogWriter
extends java.lang.Object

- flag for turning off logging after # times unsuccessful writes (2) or can't connect (1 retry) - timestamp when turned off - determine period to reset flags - on msg write - check flag or if period for resume retry - any messages sent during the down time will not written out by this logger - add System.err messages when restarting and stopping the logging


Nested Class Summary
static class DbLogWriter.ColumnName
           
 
Field Summary
static java.lang.String DATABASE_PROPERTY_NAME
          The name of the property that contains the name JDBC database to which log messages are to be recorded.
static int DEFAULT_MAX_EXCEPTION_LENGTH
           
static int DEFAULT_MAX_GENERAL_LENGTH
           
static int DEFAULT_MAX_MSG_LENGTH
           
static java.lang.String DEFAULT_TABLE_NAME
           
static java.lang.String DRIVER_PROPERTY_NAME
          The name of the property that contains the JDBC driver of the JDBC database to which log messages are to be recorded.
static java.lang.String MAX_EXCEPTION_LENGTH_PROPERTY_NAME
          The name of the property that contains the name of the table to which log messages are to be recorded.
static java.lang.String MAX_GENERAL_LENGTH_PROPERTY_NAME
          The name of the property that contains the maximum length allowed for the general column (exception message and exception).
static java.lang.String MAX_MESSAGE_LENGTH_PROPERTY_NAME
          The name of the property that contains the maximum length allowed for the column that contains the message portion.
static java.lang.String PASSWORD_PROPERTY_NAME
          The name of the property that contains the password of the JDBC database to which log messages are to be recorded.
static java.lang.String PLUGIN_PREFIX
           
static java.lang.String PRINCIPAL_PROPERTY_NAME
          The name of the property that contains the principal of the JDBC database to which log messages are to be recorded.
static java.lang.String PROTOCOL_PROPERTY_NAME
          The name of the property that contains the protocol that should be used to connect to the JDBC database to which log messages are to be recorded.
static java.lang.String TABLE_PROPERTY_NAME
          The name of the property that contains the name of the table to which log messages are to be recorded.
 
Constructor Summary
DbLogWriter(java.util.Properties properties)
           
 
Method Summary
 java.lang.String getTableName(java.util.Properties props)
           
 void initialize()
          Initialize this destination with the specified properties.
 void logMessage(LogMessage msg)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATABASE_PROPERTY_NAME

public static final java.lang.String DATABASE_PROPERTY_NAME
The name of the property that contains the name JDBC database to which log messages are to be recorded. This is a required property that has no default.

See Also:
Constant Field Values

PROTOCOL_PROPERTY_NAME

public static final java.lang.String PROTOCOL_PROPERTY_NAME
The name of the property that contains the protocol that should be used to connect to the JDBC database to which log messages are to be recorded. This is a required property that has no default.

See Also:
Constant Field Values

DRIVER_PROPERTY_NAME

public static final java.lang.String DRIVER_PROPERTY_NAME
The name of the property that contains the JDBC driver of the JDBC database to which log messages are to be recorded. This is a required property that has no default.

See Also:
Constant Field Values

PRINCIPAL_PROPERTY_NAME

public static final java.lang.String PRINCIPAL_PROPERTY_NAME
The name of the property that contains the principal of the JDBC database to which log messages are to be recorded. This is a required property that has no default.

See Also:
Constant Field Values

PASSWORD_PROPERTY_NAME

public static final java.lang.String PASSWORD_PROPERTY_NAME
The name of the property that contains the password of the JDBC database to which log messages are to be recorded. This is a required property that has no default.

See Also:
Constant Field Values

TABLE_PROPERTY_NAME

public static final java.lang.String TABLE_PROPERTY_NAME
The name of the property that contains the name of the table to which log messages are to be recorded. This is an optional property that defaults to "log".

See Also:
Constant Field Values

MAX_MESSAGE_LENGTH_PROPERTY_NAME

public static final java.lang.String MAX_MESSAGE_LENGTH_PROPERTY_NAME
The name of the property that contains the maximum length allowed for the column that contains the message portion. This is an optional property that defaults to "2000"; if supplied value is 0 then the length is not checked for each message prior to insertion.

See Also:
Constant Field Values

MAX_GENERAL_LENGTH_PROPERTY_NAME

public static final java.lang.String MAX_GENERAL_LENGTH_PROPERTY_NAME
The name of the property that contains the maximum length allowed for the general column (exception message and exception). This is an optional property that defaults to "64"; if supplied value is 0 then the length is not checked for each message prior to insertion.

See Also:
Constant Field Values

MAX_EXCEPTION_LENGTH_PROPERTY_NAME

public static final java.lang.String MAX_EXCEPTION_LENGTH_PROPERTY_NAME
The name of the property that contains the name of the table to which log messages are to be recorded. This is an optional property that defaults to "4000"; if supplied value is 0 then the length is not checked for each message prior to insertion.

See Also:
Constant Field Values

DEFAULT_TABLE_NAME

public static final java.lang.String DEFAULT_TABLE_NAME
See Also:
Constant Field Values

DEFAULT_MAX_GENERAL_LENGTH

public static final int DEFAULT_MAX_GENERAL_LENGTH
See Also:
Constant Field Values

DEFAULT_MAX_EXCEPTION_LENGTH

public static final int DEFAULT_MAX_EXCEPTION_LENGTH
See Also:
Constant Field Values

DEFAULT_MAX_MSG_LENGTH

public static final int DEFAULT_MAX_MSG_LENGTH
See Also:
Constant Field Values

PLUGIN_PREFIX

public static final java.lang.String PLUGIN_PREFIX
See Also:
Constant Field Values
Constructor Detail

DbLogWriter

public DbLogWriter(java.util.Properties properties)
Method Detail

shutdown

public void shutdown()

getTableName

public java.lang.String getTableName(java.util.Properties props)

initialize

public void initialize()
Initialize this destination with the specified properties.

Parameters:
props - the properties that this destination should use to initialize itself.
Throws:
LogDestinationInitFailedException - if there was an error during initialization.

logMessage

public void logMessage(LogMessage msg)


Copyright © 2009. All Rights Reserved.