Files
pathfinder/app/Lib/Logging/ApiLog.php
Mark Friedrich 647bd7db58 - BC Break: _PHP_ namespaces changed (PSR-4 standard). The _root_ namespace for all _PF_ related scripts is Exodus4D\Pathfinder
- BC Break: Project folder structure changed. Removed `app/main` dir.
- BC Break: Core _PHP_ framework + dependencies moved into `composer.json` and are no longer part of this repo
2019-12-15 22:27:17 +01:00

49 lines
1.1 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: Exodus 4D
* Date: 01.01.2019
* Time: 16:42
*/
namespace Exodus4D\Pathfinder\Lib\Logging;
class ApiLog extends AbstractLog {
/**
* List of possible handlers (tested)
* -> final handler will be set dynamic for per instance
* @var array
*/
protected $handlerConfig = [
//'stream' => 'json'
];
/**
* @var string
*/
protected $channelType = 'api';
/**
* ApiLog constructor.
* @param string $action
* @param string $level
* @throws \Exception
*/
public function __construct(string $action, string $level){
parent::__construct($action);
$this->setLevel($level);
}
/**
* overwrites parent
* -> we need unique channelNames for different $actions within same $channelType
* -> otherwise logs would be bundled into the first log file handler
* @return string
*/
public function getChannelName(): string{
return $this->getChannelType() . '_' . $this->getAction();
}
}