coderockr / silex-application-log
该包的最新版本(dev-master)没有可用的许可信息。
应用程序日志
dev-master
2017-07-27 13:30 UTC
Requires
- monolog/monolog: ^1.17
- sentry/sentry: ^1.8@dev
- silex/silex: v1.3.4
Requires (Dev)
- mockery/mockery: ^1.0@dev
- phpunit/phpunit: 4.6.*
This package is not auto-updated.
Last update: 2024-09-14 17:32:06 UTC
README
Silex 应用程序日志
要求
"silex/silex": "v1.3.4"
和 "monolog/monolog": "^1.17"
安装
php composer.phar require coderockr/silex-application-log
配置
可选的键:processor
、streamHandler
、slackHandler
和 logglyHandler
$config = [
'config' => [
'applicationLog' => [
'name' => 'Name You Log',
'processor' => [ //opcional
'Monolog\Processor\IntrospectionProcessor',
'Monolog\Processor\MemoryUsageProcessor',
'Monolog\Processor\ProcessIdProcessor',
'Monolog\Processor\WebProcessor',
],
'streamHandler' => [
'stream' => 'path/to/application.log',
'level' => 'DEBUG', //opcional
'bubble' => true, //opcional
'filePermission' => null, //opcional
'useLocking' => false //opcional
],
'slackHandler' => [
'token' => '1234567890',
'channel' => '#tests',
'username' => 'tests', //opcional
'useAttachment' => 'attach user', //opcional
'iconEmoji' => ':sweat:', //opcional
'level' => 'CRITICAL', //opcional
'bubble' => true, //opcional
'useShortAttachment' => false, //opcional
'includeContextAndExtra' => false //opcional
],
'logglyHandler' => [
'token' => '1234567890',
'level' => 'ERROR', //opcional
'bubble' => true //opcional
],
'sentryHandler' => [
'token' => '1234567890',
'level' => 'ERROR', //opcional
],
]
]
];
用法
$app = new Application();
$app->register(new \ApplicationLog\Provider\ApplicationLog(), $config);