Package ch.k43.util

Klasse KLogJDBCHandler

java.lang.Object
java.util.logging.Handler
ch.k43.util.KLogJDBCHandler

public class KLogJDBCHandler extends Handler
Java logging handler to output logging data to any compliant JDBC database. The log data rows are deleted according to the parameter retensiondays during KLogJDBCHandler class instantiation. If the table does not exist during class instantiation, the table will be created with the following SQL statement:
 CREATE TABLE {TableName} (UUID CHAR(36), LOGTIME TIMESTAMP, LEVEL VARCHAR(20), LOCATION VARCHAR(80), TEXT VARCHAR(500))
 
The following properties are supported:
 ch.k43.util.KLogJDBCHandler.jdbc.driver = Java class name
 ch.k43.util.KLogJDBCHandler.jdbc.url = JDBC connection URL, e.g. jdbc:h2:/Users/jsmith/KLogDB
 ch.k43.util.KLogJDBCHandler.jdbc.username = User name
 ch.k43.util.KLogJDBCHandler.jdbc.password = Password
 ch.k43.util.KLogJDBCHandler.tablename = SQL table name (default KLOGDATA)
 ch.k43.util.KLogJDBCHandler.retensiondays = Number of days before log records are deleted (default 30)
 ch.k43.util.KLogJDBCHandler.debug = true/false (Output sent to System.out/System.err, default false)   
 
Seit:
2024.06.16
  • Konstruktordetails

    • KLogJDBCHandler

      public KLogJDBCHandler()
      Class constructor.
  • Methodendetails

    • close

      public void close()
      Close the handler.
      Angegeben von:
      close in Klasse Handler
    • flush

      public void flush()
      Commit JDBC transaction.
      Angegeben von:
      flush in Klasse Handler
    • publish

      public void publish(LogRecord argRecord)
      Write log record to JDBC database.
      Angegeben von:
      publish in Klasse Handler
      Parameter:
      argRecord - Log record
    • toString

      public String toString()
      String representation of object.
      Setzt außer Kraft:
      toString in Klasse Object
      Seit:
      2024.08.23