thesaturn / xmpplogger
符合PSR3规范的PHP XMPPLogger
1.0.1
2017-03-28 12:28 UTC
Requires
- php: >=5.3.3
- fabiang/xmpp: ^0.6.1
- psr/log: ~1.0
Suggests
- psr/log-implementation: Allows more advanced logging of the xmpp connection
This package is not auto-updated.
Last update: 2024-09-28 22:37:40 UTC
README
这是一个简单的符合PSR3规范的PHP XMPPLogger。使用Fabiang XMPP客户端发送消息。
系统要求
PHP >= 5.3
用法
首先,您需要设置XMPP连接
use Fabiang\Xmpp\Options;
use Fabiang\Xmpp\Client;
$options = new Options('tcp://example.com:5222');
$options->setUsername('twilight')->setPassword('sparkle');
$client = new Client($options);
现在您可以创建日志记录器
use \thesaturn\xmpplogger\XMPPLogger;
$log = new XMPPLogger($client, $config['xmpp']['to'], 'debug');
$log->info("Hello log");
安装
将以下行添加到composer中
"require": {
"thesaturn/xmpplogger": "1.0"
}