ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
class.ilLoggingMetricsCollectedObjective.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
24 
26 {
27  protected function getTentativePreconditions(Environment $environment): array
28  {
29  return [
31  ];
32  }
33 
34  protected function collectFrom(Environment $environment, Storage $storage): void
35  {
36  $ini = $environment->getResource(Environment::RESOURCE_ILIAS_INI);
37  if (!$ini) {
38  return;
39  }
40 
41  $storage->storeConfigBool(
42  "enable",
43  (bool) $ini->readVariable("log", "enabled"),
44  "Is the logging enabled on the installation?"
45  );
46  $storage->storeConfigText(
47  "path_to_logfile",
48  $ini->readVariable("log", "path") . "/" . $ini->readVariable("log", "file"),
49  "The path to the logfile."
50  );
51  $storage->storeConfigText(
52  "errorlog_dir",
53  $ini->readVariable("log", "error_path"),
54  "The path to the directory where error protocols are stored."
55  );
56  }
57 }
storeConfigBool(string $key, bool $value, ?string $description=null)
storeConfigText(string $key, string $value, ?string $description=null)
Base class to simplify collection of metrics.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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:20