Overview

Log adapter to save one event in multiple logs.

<?php
// config for a multiple log
$config = array(
    'adapter' => 'Solar_Log_Adapter_Multi', // could also be a dependency object?
    'adapters' => array(
        array(
            'adapter' => 'Solar_Log_Adapter_File',
            'events' => '*',
            'format' => null,
            'file' => '/path/to/file.log',
        ),
        array(
            'adapter' => 'Solar_Log_Adapter_Echo',
            'events' => 'debug',
            'format' => null,
        ),
        array(
            'adapter' => 'Solar_Log_Adapter_Sql',
            'events' => 'warning, severe, critical',
            'sql'    => 'sql',
            'table'  => 'table_name',
            '%t'     => 'ts',
            '%e'     => 'evt',
            '%m'     => 'msg',
        ),
    ),
);
$log = Solar::factory('Solar_Log', $config);

Package

This class is part of the Solar_Log package.

Inheritance:

Configuration Keys

  • events: The event types this instance should recognize; a comma-separated string of events, or a sequential array. Default is all events ('*').

  • microtime: Use timestamps with decimal microseconds. Default false.

  • adapters: An array of arrays, where each sub-array is a separate adapter configuration.

Constants

None.

Public Properties

The Solar_Log_Adapter_Multi class has no public properties; try the list of all properties.

Public Methods

These are all the public methods in the Solar_Log_Adapter_Multi class.

You can also view the list of all public, protected, and private methods.

__construct()

Constructor.

__destruct()

Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().

dump()

Convenience method for getting a dump the whole object, or one of its properties, or an external variable.

getEvents()

Gets the list of events this adapter recognizes.

locale()

Looks up class-specific locale strings based on a key.

save()

Saves (writes) an event and message to the log.

setEvents()

Sets the list of events this adapter recognizes.



Local