Logger Factory
Logger factory for everyday simple configuration
Installation
composer require d3/logger-factory
Usage
use D3\LoggerFactory\LoggerFactory;
$loggerFactory = LoggerFactory::create();
$logger = $loggerFactory->getFileLogger(
'myPluginLogger',
'plugin_requests.log',
Logger::DEBUG,
5
);
Use of the special handler
use D3\LoggerFactory\LoggerFactory;
$loggerFactory = LoggerFactory::create();
$logger = $loggerFactory->getFileLogger(
'myPluginLogger',
'plugin_requests.log',
Logger::DEBUG,
5,
[
LoggerFactory::SPECIAL_HANDLERS_LOG_ON_ERROR_ONLY, // simple default configuration
LoggerFactory::SPECIAL_HANDLERS_BUFFERING,
LoggerFactory::SPECIAL_HANDLERS_MAKE_UNIQUE => [ // advanced custom configuration
LoggerFactory::MAKEUNIQUE_OPTION_LEVEL => Logger::INFO
],
],
[] // optional processor flags
);
Processors can also be inserted with the analogue configuration:
use D3\LoggerFactory\LoggerFactory;
$loggerFactory = LoggerFactory::create();
$logger = $loggerFactory->getFileLogger(
'myPluginLogger',
'plugin_requests.log',
Logger::DEBUG,
5,
[], // optional special handler flags
[
LoggerFactory::PROCESSOR_UNIQUE_ID, // simple default configuration
LoggerFactory::PROCESSOR_FILTERSENSITIVE => [ // simple default configuration
LoggerFactory::FILTERSENSITIVE_SECRETS => ['secret1', 'secret2']
],
]
);
Licence of this software (Logger factory) [MIT]
(05.02.2025)
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Description
Languages
PHP
100%