Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
OpenXPKI::Server::Log:UsereContributedXPerl:Server::Log::Appender::Database(3)

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

Description
       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.

Configuration
   Log4perl Basic Config
       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 Optional Parameters
       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.

Database
   Schema
	   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;

   Fields
       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.

perl v5.32.0			  OpenXPKI::Server::Log::Appender::Database(3)

Name | Description | Configuration | Database

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=OpenXPKI::Server::Log::Appender::Database&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help