2014-02-26 10:47:02 +01:00
|
|
|
<?php
|
2015-02-04 10:46:36 +01:00
|
|
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
2014-02-26 10:47:02 +01:00
|
|
|
|
2014-10-31 10:27:17 +01:00
|
|
|
namespace Icinga\Application\Logger;
|
2014-02-26 10:47:02 +01:00
|
|
|
|
2014-11-18 13:11:52 +01:00
|
|
|
use Icinga\Data\ConfigObject;
|
2014-02-26 10:47:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Abstract class for writers that write messages to a log
|
|
|
|
*/
|
|
|
|
abstract class LogWriter
|
|
|
|
{
|
2014-11-11 19:39:15 +01:00
|
|
|
/**
|
2014-11-18 13:11:52 +01:00
|
|
|
* @var ConfigObject
|
2014-11-11 19:39:15 +01:00
|
|
|
*/
|
|
|
|
protected $config;
|
|
|
|
|
2014-02-26 10:47:02 +01:00
|
|
|
/**
|
|
|
|
* Create a new log writer initialized with the given configuration
|
|
|
|
*/
|
2014-11-18 13:11:52 +01:00
|
|
|
public function __construct(ConfigObject $config)
|
2014-11-11 19:39:15 +01:00
|
|
|
{
|
|
|
|
$this->config = $config;
|
|
|
|
}
|
2014-02-26 10:47:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Log a message with the given severity
|
|
|
|
*/
|
|
|
|
abstract public function log($severity, $message);
|
|
|
|
}
|