add settings to customize webserver logs

Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
This commit is contained in:
Michael Kaufmann
2018-05-24 11:36:13 +02:00
parent 07a3f76568
commit 5a070d6d91
7 changed files with 88 additions and 6 deletions

View File

@@ -733,8 +733,22 @@ class apache extends HttpConfigBase
chown($access_log, Settings::Get('system.httpuser'));
chgrp($access_log, Settings::Get('system.httpgroup'));
$logfiles_text .= ' ErrorLog "' . $error_log . "\"\n";
$logfiles_text .= ' CustomLog "' . $access_log . '" combined' . "\n";
$logtype = 'combined';
if (Settings::Get('system.logfiles_format') != '') {
$logtype = 'frx_custom';
$logfiles_text .= ' LogFormat "' . Settings::Get('system.logfiles_format') . '" ' . $logtype . "\n";
}
if (Settings::Get('system.logfiles_type') == '2' && Settings::Get('system.logfiles_format') == '') {
$logtype = 'vhost_combined';
}
if (Settings::Get('system.logfiles_piped') == '1') {
$logfiles_text .= ' ErrorLog "|' . str_replace('{LOGFILE}', $error_log, Settings::Get('system.logfiles_directory')) . "\"\n";
$logfiles_text .= ' CustomLog "|' . str_replace('{LOGFILE}', $access_log, Settings::Get('system.logfiles_directory')) . '" ' . $logtype . "\n";
} else {
$logfiles_text .= ' ErrorLog "' . $error_log . '"' . "\n";
$logfiles_text .= ' CustomLog "' . $access_log . '" ' . $logtype . "\n";
}
if (Settings::Get('system.awstats_enabled') == '1') {
if ((int) $domain['parentdomainid'] == 0) {