Package ch.k43.util
Klasse KLogJDBCHandler
java.lang.Object
java.util.logging.Handler
ch.k43.util.KLogJDBCHandler
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
-
Konstruktorübersicht
-
Methodenübersicht
Von Klasse geerbte Methoden java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Konstruktordetails
-
KLogJDBCHandler
public KLogJDBCHandler()Class constructor.
-
-
Methodendetails
-
close
public void close()Close the handler. -
flush
public void flush()Commit JDBC transaction. -
publish
Write log record to JDBC database. -
toString
String representation of object.
-