Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(broker): fix export of cbd watchdog logs path #6919

Merged
merged 1 commit into from
Nov 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions www/class/config-generate/broker.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class Broker extends AbstractObjectXML
id,
name,
centreonbroker_module_path,
centreonbroker_cfg_path
centreonbroker_cfg_path,
centreonbroker_logs_path
';
protected $exclude_parameters = array(
'blockId'
Expand Down Expand Up @@ -236,9 +237,15 @@ private function generate($poller_id, $localhost)
$this->generateFile($object, true, 'centreonBroker');
$this->writeFile($this->backend_instance->getPath());
}

// Manage path of cbd watchdog log
$watchdogLogsPath = trim($this->engine['broker_logs_path']) === '' ?
'/var/log/centreon-broker/watchdog.log' :
trim($this->engine['broker_logs_path']) . '/watchdog.log';
$watchdog[] = array(
'log' => '/var/log/centreon-broker/watchdog.log'
'log' => $watchdogLogsPath
);

$this->generate_filename = 'watchdog.xml';
$this->generateFile($watchdog, true, 'centreonbroker');
$this->writeFile($this->backend_instance->getPath());
Expand All @@ -261,6 +268,7 @@ private function getEngineParameters($poller_id)
$this->engine['name'] = $row['name'];
$this->engine['broker_modules_path'] = $row['centreonbroker_module_path'];
$this->engine['broker_cfg_path'] = $row['centreonbroker_cfg_path'];
$this->engine['broker_logs_path'] = $row['centreonbroker_logs_path'];
} catch (Exception $e) {
throw new Exception('Exception received : ' . $e->getMessage() . "\n");
}
Expand Down