aatis/logger
最新稳定版本:1.0.2
Composer 安装命令:
composer require aatis/logger
包简介
Logger of Aatis
README 文档
README
Installation
composer require aatis/logger
Usage
Requirements
By default the log file is set to var/app.log and the timezone is set to Europe/Paris but you can change them by setting the LOG_PATH and TIMEZONE environment variables.
Basic method
Choose a LogLevel for the message you want to log and pass the message with it context.
Your can include variable into your message with the following syntax : {variable}
$var = 'set'; $logger->log(LogLevel::INFO, 'Logger is {example} !', ['example' => $var]); // Output : [14-01-2024 22:06:12] INFO Logger is set !
Specific methods
You can use the following methods to log a message with a specific level of log.
Like the basic method, each ones take the message and the context of it as parameters.
$logger->info('Info message'); // Output : [14-01-2024 22:06:12] INFO Info message $logger->notice('Notice message'); // Output : [14-01-2024 22:06:12] NOTICE Notice message $logger->warning('Warning message'); // Output : [14-01-2024 22:06:12] WARNING Warning message $logger->error('Error message'); // Output : [14-01-2024 22:06:12] ERROR Error message $logger->critical('Critical message'); // Output : [14-01-2024 22:06:12] CRITICAL Critical message $logger->alert('Alert message'); // Output : [14-01-2024 22:06:12] ALERT Alert message $logger->emergency('Emergency message'); // Output : [14-01-2024 22:06:12] EMERGENCY Emergency message $logger->debug('Debug message'); // Output : [14-01-2024 22:06:12] DEBUG Debug message
With Aatis Framework
Requirements
Add the Logger to the Container:
# In config/services.yaml file : include_services: - 'Aatis\Logger\Service\Logger'
统计信息
- 总下载量: 71
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-12-17