feat: enable/disable log drain by service

This commit is contained in:
Andras Bacsai
2023-11-17 20:08:21 +01:00
parent b0c96e64c9
commit 3b20eee909
37 changed files with 270 additions and 24 deletions

View File

@@ -69,7 +69,7 @@ class StartMariadb
]
]
];
if ($this->database->destination->server->isDrainLogActivated()) {
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [

View File

@@ -76,7 +76,7 @@ class StartMongodb
]
]
];
if ($this->database->destination->server->isDrainLogActivated()) {
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [

View File

@@ -69,7 +69,7 @@ class StartMysql
]
]
];
if ($this->database->destination->server->isDrainLogActivated()) {
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [

View File

@@ -79,7 +79,8 @@ class StartPostgresql
]
]
];
if ($this->database->destination->server->isDrainLogActivated()) {
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
ray('Log Drain Enabled');
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [

View File

@@ -78,7 +78,7 @@ class StartRedis
]
]
];
if ($this->database->destination->server->isDrainLogActivated()) {
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [
@@ -166,6 +166,5 @@ class StartRedis
$content = $this->database->redis_conf;
$content_base64 = base64_encode($content);
$this->commands[] = "echo '{$content_base64}' | base64 -d > $this->configuration_dir/{$filename}";
}
}

View File

@@ -127,6 +127,7 @@ services:
- ./parsers.conf:/parsers.conf
ports:
- 127.0.0.1:24224:24224
restart: unless-stopped
");
$readme = base64_encode('# New Relic Log Drain
This log drain is based on [Fluent Bit](https://fluentbit.io/) and New Relic Log Forwarder.