Skip to content

Commit

Permalink
Merge branch '2024.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlabci committed Feb 11, 2025
2 parents bb4f4fd + 701870c commit 586048f
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 114 deletions.
60 changes: 57 additions & 3 deletions docs/operators/Logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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',
],
107 changes: 0 additions & 107 deletions docs/operators/howto/tine20AdminLogging.md

This file was deleted.

9 changes: 5 additions & 4 deletions tine20/Tinebase/Frontend/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -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. ';;;;';
Expand Down

0 comments on commit 586048f

Please sign in to comment.