From b83c752d304f190cbe11c8ef053320a6ca3a1133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Sch=C3=BCle?= Date: Tue, 11 Feb 2025 09:51:29 +0100 Subject: [PATCH 1/2] docs(operators/logging): moved infos from howto/Logger to Logging --- docs/operators/Logging.md | 60 +++++++++++- docs/operators/howto/tine20AdminLogging.md | 107 --------------------- 2 files changed, 57 insertions(+), 110 deletions(-) delete mode 100644 docs/operators/howto/tine20AdminLogging.md diff --git a/docs/operators/Logging.md b/docs/operators/Logging.md index 1d5cc5768f8..3ec29052014 100644 --- a/docs/operators/Logging.md +++ b/docs/operators/Logging.md @@ -16,8 +16,8 @@ Example log line: - c352c2 => Request ID (random string created by server) - 26d1a => Transaction ID (random string created by client - from $REQUEST) - setupuser => Current User (login name) -- 648ms => Total time of the request -- 0ms => Time passed since the last logged line +- 648ms => Total time of the request (logruntime) +- 0ms => Time passed since the last logged line (logdifftime) - 2025-02-06T14:08:37+00:00 => Timestamp in configured TZ (default: UTC, see "Set Timezone for Logging") - WARN (4) => Log level (see "Logger Priorities") - Tinebase_FileSystem::_isFileIndexingActive::180 => Class name::function name::line number in PHP file @@ -37,7 +37,44 @@ Example log line: const TRACE = 8; // Trace: trace messages ``` -## Set Timezone for Logging + +## Logger Configuration + +### Show Timestamps + +Folgende Konfigurationsoptionen können genutzt werden, um die Gesamtlaufzeit eines Requests (logruntime) +und die Zeitdauer/Abstand vom letzten Logeintrag (logdifftime) anzuzeigen: + + 'logger' => [ + [...] + 'logruntime' => true, + 'logdifftime' => true, + ] + +### Logging to Standard Out + + 'logger' => [ + [...] + 'filename' => 'php://stdout', + ], + +### Colorized Logs + + 'logger' => [ + [...] + 'colorize' => true, + ], + +### JSON Logger + +Log-Nachrichten werden JSON-kodiert abgelegt. + + 'logger' => [ + [...] + 'formatter' => 'json', + ], + +### Set Timezone for Logging see https://github.com/tine-groupware/tine/issues/44 @@ -51,3 +88,20 @@ The logger timezone can be configured via the 'tz' option: ~~~ see https://www.php.net/manual/de/function.date-default-timezone-set.php for supported timezones. + + +### Logging of Cache-Hits/Tests/Saves + + 'caching' => [ + [...] + 'logging' => true, + ], + +### Database Logger + +Der DB-Logger schreibt seine Log-Einträge direkt in die Datenbank, sie können dann im Admin-Bereich eingesehen werden. + + 'dblogger' => [ + 'active' => true, + 'priority' => '4', + ], diff --git a/docs/operators/howto/tine20AdminLogging.md b/docs/operators/howto/tine20AdminLogging.md deleted file mode 100644 index 1defafa42e0..00000000000 --- a/docs/operators/howto/tine20AdminLogging.md +++ /dev/null @@ -1,107 +0,0 @@ -Tine Admin HowTo: Logging -================= - -Version: Amon 2020.11 - -Konfiguration der verschiedenen Logger - -Logger-Konfiguration (Beispiel) -================= - - 'logger' => array ( - 'active' => true, - 'filename' => '/tine/logs/tine20_notice.log', - 'priority' => '5', - 'logruntime' => true, - 'logdifftime' => true, - 'colorize' => true, - 'additionalWriters' => array(array( - 'active' => true, - 'filename' => '/tine/logs/debug.log', - 'priority' => '7', - 'filter' => array( - ), - ), array( - 'active' => true, - 'filename' => '/tine/logs/json.log', - 'priority' => '6', - 'formatter' => 'json', - 'filter' => array( - ), - )), - ), - -Zeiten im Log -================= - -Folgende Konfigurationsoptionen können genutzt werden, um die Gesamtlaufzeit eines Requests (logruntime) - und die Zeitdauer/Abstand vom letzten Logeintrag (logdifftime) anzuzeigen: - - 'logger' => array ( - [...] - 'logruntime' => true, - 'logdifftime' => true, - ) - -Logging nach Standard-Out -================= - - 'logger' => array ( - [...] - 'filename' => 'php://stdout', - ), - -Farbige Logs -================= - - 'logger' => array ( - [...] - 'colorize' => true, - ), - -Json-Logger -================= - -Log-Nachrichten werden JSON-kodiert abgelegt. - - 'logger' => array ( - [...] - 'formatter' => 'json', - ), - -Zusätzliche Log-Dateien (z.B. für bestimmte Benutzer) -================= - - 'logger' => array ( - [...] - 'additionalWriters' => array(array( - 'active' => true, - 'filename' => '/tine/logs/debug.log', - 'priority' => '7', - 'filter' => array( - 'user' => 'pschuele', - // message filters can also be used: - #'message' => '/Tinebase_Import_Abstract::_handleImportException/', - #'message' => '/Addressbook_Frontend_Http/', - #'message' => '/Tinebase_Backend_Sql_Abstract/', - ), - )), - ), - -Logging von Cache-Hits/Tests/Saves -================= - - 'caching' => array( - [...] - 'logging' => true, - ), - -Aktivierung des DB-Loggers -================= - -Der DB-Logger schreibt seine Log-Einträge direkt in die Datenbank, sie können dann im Admin-Bereich eingesehen werden. - - 'dblogger' => array( - 'active' => true, - 'priority' => '4', - ), From d40250348e55ffcee05e7647b3bff9c29ee4cb81 Mon Sep 17 00:00:00 2001 From: Christian Feitl Date: Tue, 11 Feb 2025 14:42:03 +0100 Subject: [PATCH 2/2] fix(Tinebase): not use quotaMonitoring config --- tine20/Tinebase/Frontend/Cli.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tine20/Tinebase/Frontend/Cli.php b/tine20/Tinebase/Frontend/Cli.php index 24bb07684e3..827646bda84 100644 --- a/tine20/Tinebase/Frontend/Cli.php +++ b/tine20/Tinebase/Frontend/Cli.php @@ -1052,12 +1052,13 @@ public function monitoringLoginNumber() public function monitoringCheckQuota(): int { $result = 0; - $config = Tinebase_Config::getInstance(); - $quotaConfig = $config->get(Tinebase_Config::QUOTA_MONITORING); + $quotaConfig = Tinebase_Config::getInstance()->{Tinebase_Config::QUOTA}; + $monitoringQuota = $quotaConfig->{Tinebase_Config::QUOTA_MONITORING}; + $totalQuota = $quotaConfig->{Tinebase_Config::QUOTA_TOTALINMB}; - if ($quotaConfig && Tinebase_FileSystem_Quota::getTotalQuotaBytes() > 0) { + if ($monitoringQuota && Tinebase_FileSystem_Quota::getTotalQuotaBytes() > 0) { $totalUsage = Tinebase_FileSystem_Quota::getRootUsedBytes(); - $usagePercentage = ($totalUsage / $quotaConfig) * 100; + $usagePercentage = ($totalUsage / $totalQuota) * 100; if ($usagePercentage >= 99) { $message = 'QUOTA LIMIT REACHED | usage=' . $totalUsage. ';;;;';