credy/yii2-graylog-target
最新稳定版本:1.0.0
Composer 安装命令:
composer require credy/yii2-graylog-target
包简介
Yii2 graylog2 log target
README 文档
README
Yii2 graylog2 log target
Installation
The preferred way to install this extension is through composer.
Either run
$ composer require credy/yii2-graylog-target
or add
"credy/yii2-graylog-target": "^0.1"
to the `require` section of your composer.json file.
Configuration
'as newIdBehavior' => credy\graylog\behaviors\GenerateNewIdBehavior::class,
'components' => [
'log' => [
'targets' => [
[
'class' => credy\graylog\Target::class,
'publisher' => [
'class' => credy\graylog\Publisher::class,
'categories' => ['application'],
'facility' => 'my-application',
'transports' => [
[
'class' => credy\graylog\transport\UdpTransport::class,
'host' => '192.168.1.1',
'port' => 1234,
'chunkSize' => 4321,
],
[
'class' => credy\graylog\transport\TcpTransport::class,
'host' => '192.168.1.2',
'port' => 1234,
'sslOptions' => [
'allowSelfSigned' => true,
'verifyPeer' => false,
],
]
],
],
],
],
],
],
Transports
UDP transport
$transport = new credy\graylog\transport\UdpTransport([
// Host name or IP. Default to 127.0.0.1
'host' => 'graylog.example.org',
// UDP port. Default to 12201
'port' => 1234,
// UDP chunk size. Default to 8154
'chunkSize' => 4321,
]);
TCP transport
$transport = new credy\graylog\transport\UdpTransport([
// Host name or IP. Default to 127.0.0.1
'host' => 'graylog.example.org',
// TCP port. Default to 12201
'port' => 12201,
// SSL options. (optional)
'sslOptions' => [
// Default to true
'verifyPeer' => false,
// Default to false
'allowSelfSigned' => true,
// Default to null
'caFile' => '/path/to/ca.file',
// Default to null
'ciphers' => 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256',
],
]);
HTTP transport
$transport = new credy\graylog\transport\HttpTransport([
// Host name or IP. Default to 127.0.0.1
'host' => 'graylog.example.org',
// HTTP port. Default to 12202
'port' => 12202,
// Query path. Default to /gelf
'path' => '/my/custom/greylog',
// SSL options. (optional)
'sslOptions' => [
// Default to true
'verifyPeer' => false,
// Default to false
'allowSelfSigned' => true,
// Default to null
'caFile' => '/path/to/ca.file',
// Default to null
'ciphers' => 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256',
],
]);
统计信息
- 总下载量: 2.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-17