yiisoft / log-target-syslog
Yii Logging Library - Syslog Target
Fund package maintenance!
Open Collective
yiisoft
Requires
- php: ^8.0
- psr/log: ^3.0
- yiisoft/log: ^2.0
Requires (Dev)
- maglnet/composer-require-checker: ^4.2
- php-mock/php-mock-phpunit: ^2.6
- phpunit/phpunit: ^9.5
- rector/rector: ^0.15.1
- roave/infection-static-analysis-plugin: ^1.25
- spatie/phpunit-watcher: ^1.23
- vimeo/psalm: ^4.30|^5.6
- yiisoft/di: ^1.2
This package is auto-updated.
Last update: 2023-03-06 22:03:35 UTC
README
Yii Logging Library - Syslog Target
This package provides the Syslog target for the yiisoft/log library.
Requirements
- PHP 8.0 or higher.
Installation
The package could be installed with composer:
composer require yiisoft/log-target-syslog --prefer-dist
General usage
Creating a target:
use Yiisoft\Log\Target\Syslog\SyslogTarget; $syslogTarget = new SyslogTarget($identity, $options, $facility);
$identity (string)
- Theopenlog()
identity.$options (int)
- Theopenlog()
options. Defaults toLOG_ODELAY | LOG_PID
.$facility (int)
- Theopenlog()
facility. Defaults toLOG_USER
.
For more information, see the description of the openlog()
function.
Creating a logger:
$logger = new \Yiisoft\Log\Logger([$syslogTarget]);
For a description of using the logger, see the yiisoft/log package.
For use in the Yii framework, see the configuration files:
See Yii guide to logging for more info.
Testing
Unit testing
The package is tested with PHPUnit. To run tests:
./vendor/bin/phpunit
Mutation testing
The package tests are checked with Infection mutation framework. To run it:
./vendor/bin/infection
Static analysis
The code is statically analyzed with Psalm. To run static analysis:
./vendor/bin/psalm
Support the project
Follow updates
License
The Yii Logging Library - Syslog Target is free software. It is released under the terms of the BSD License.
Please see LICENSE
for more information.
Maintained by Yii Software.