system-log
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • Phramework
    • Exceptions
    • SystemLog
      • Log

Classes

  • DatabaseLog
  • FileLog
  • TerminalLog

Interfaces

  • ILog

Class DatabaseLog

Log implementation using databse as storage Defined settings:

  • object system-log
    • object database-log
      • string adapter, IAdapter's implementation class (full class path)
      • string host
      • string port
      • string name
      • string username
      • string password
      • string schema, [Optional], Table's schema, default is null
      • string table, [Optional], Table's name, default is "system-log"

To use DatabaseLog:
- Set system-log's log to 'Phramework\\SystemLog\\APP\\Log\\DatabaseLog'
- Add database-log objecto to your settings
See this class's __construct method for an example.

Phramework\SystemLog\Log\DatabaseLog implements Phramework\SystemLog\Log\ILog
Namespace: Phramework\SystemLog\Log
License: Apache-2.0
Author: Xenofon Spafaridis nohponex@gmail.com
Since: 0.0.0
Located at Log/DatabaseLog.php

Methods summary

public
# __construct( object $settings )

Parameters

$settings
System log instance settings

Throws

Exception
Phramework\Exceptions\ServerException

Example

// To use DatabaseLog
// Set system-log's setting log to 'Phramework\\SystemLog\\APP\\Log\\DatabaseLog'
// Add database-log object to your system-log settings
$settings = [
    'system-log' => (object)[
        'log' => 'Phramework\\SystemLog\\APP\\Log\\DatabaseLog',
        'database-log' => (object)[
            'adapter'  => 'Phramework\\Database\\PostgreSQL',
            'host'     => '127.0.0.1',
            'name'     => 'db_name',
            'password' => 'db_pass',
            'username' => 'db_user',
            'port'     => 5432,
            'schema'   => 'log'
        ]
    ]
];

public string
# log( string $step, object $data )

Parameters

$step
$data
Log object

Returns

string
Returns the id of inserted record

Todo

surround with try catch

Implementation of

Phramework\SystemLog\Log\ILog::log()
public
# __destruct( )

Properties summary

protected null|string $schema

Table's schema, null if default is used

Table's schema, null if default is used

# null
protected string $table

Table's

Table's

# 'system_log'
protected Phramework\Phramework\Database\IAdapter $logAdapter

Internal database adapter used to log object to database

Internal database adapter used to log object to database

#
system-log API documentation generated by ApiGen