toshkq93 / custom-logger

PSR-3 日志记录器

1.0.0 2023-02-06 11:05 UTC

This package is auto-updated.

Last update: 2024-09-06 14:46:22 UTC


README

安装

通过 composer 安装此包

composer require toshkq93/custom-logger

配置和使用

$logger_file = Logger::factory(FileDriver::class, ['filePath' => 'data/default.log']);

$logger_db = Logger::factory(DatabaseDriver::class, [
    'dsn' => 'mysql:host=127.0.0.1;dbname=test;charset=utf8',
    'table' => 'qwerty',
    'username' => 'root',
    'password' => '',
]);

$logger_db->info('test');
$logger_file->info('text');

安全

如果您发现任何与安全相关的问题,请通过电子邮件 a.stanovoi170993@gmail.com 反馈,而不是使用问题跟踪器。

许可协议

MIT 许可协议(MIT)。有关更多信息,请参阅许可文件