GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OpenXPKI::Server::Log::Appender::Database(3) User Contributed Perl Documentation OpenXPKI::Server::Log::Appender::Database(3)

OpenXPKI::Server::Log::Appender::Database

This class implements an appender for Log4perl that writes messages to the database. It uses the internal DBI layer and runs inside the transaction model, so messages are only persisted when the "outer" layer properly commits the transaction.

Opposite to the default DBI Appender, the table layout is fixed and you can only control the layout of the message that is written.

In the default setup, this class is used to write the "Technical Log" for the workflow views but you can use it for any other purpose, too.

The minimal configuration requires only the layout class, the default layout is to log the message only:

log4perl.appender.Application = OpenXPKI::Server::Log::Appender::Database log4perl.appender.Application.layout = Log::Log4perl::Layout::PatternLayout

Additional layout specifications can be given, depending on the used layout class.

log4perl.appender.Application.table = application_log
The name of the table to write the data too. This also implies the name of the primary key column as "<table>_id" and the name of the sequence "seq_<table>".
log4perl.appender.Application.microseconds = 1
Weather to have microseconds in the timestamp, default is yes. This option requries the Time::HiRes module to be installed.
log4perl.appender.Application.inside_transaction = 1
By default the dbi_log handle is used which writes to the database immediately. If set to true, the DBI handle of the application layer is used which is rolled back in case of any exception which lets the log lines disappear.

    CREATE TABLE IF NOT EXISTS `application_log` (
      `application_log_id` bigint(20) unsigned NOT NULL,
      `logtimestamp` decimal(20,6) DEFAULT NULL,
      `workflow_id` decimal(49,0) NOT NULL,
      `priority` int(3) DEFAULT '999',
      `category` varchar(255) NOT NULL,
      `message` longtext
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

application_log_id
Primary key based on seqeuence (you need to create a corresponding sequence or a sequence emulation table), see the default schema for your DBI.
logtimestamp
timestamp of the event as epoch, microseconds are appended as fraction. Note that this format has changed with v1.18 and you must adjust your database to use the new format!
workflow_id
The id of the currently running worklow, 0 if no workflow was active.
priority
Log priority, stored as integer as defined in Log::Log4perl::Level
category
facility/category of the logger used
message
The actual log message, after processing by the given layout pattern.
2022-05-14 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.