ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilLoggingMetricsCollectedObjective.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /* Copyright (c) 2020 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
6 
10 
12 {
13  protected function getTentativePreconditions(Environment $environment): array
14  {
15  return [
17  ];
18  }
19 
20  protected function collectFrom(Environment $environment, Storage $storage): void
21  {
22  $ini = $environment->getResource(Environment::RESOURCE_ILIAS_INI);
23  if (!$ini) {
24  return;
25  }
26 
27  $storage->storeConfigBool(
28  "enable",
29  (bool) $ini->readVariable("log", "enabled"),
30  "Is the logging enabled on the installation?"
31  );
32  $storage->storeConfigText(
33  "path_to_logfile",
34  $ini->readVariable("log", "path") . "/" . $ini->readVariable("log", "file"),
35  "The path to the logfile."
36  );
37  $storage->storeConfigText(
38  "errorlog_dir",
39  $ini->readVariable("log", "error_path"),
40  "The path to the directory where error protocols are stored."
41  );
42  }
43 }
storeConfigText(string $key, string $value, string $description=null)
Base class to simplify collection of metrics.
storeConfigBool(string $key, bool $value, string $description=null)
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An environment holds resources to be used in the setup process.
Definition: Environment.php:27
collectFrom(Environment $environment, Storage $storage)
$ini
Definition: raiseError.php:4