ILIAS  release_8 Revision v8.23
ilLoggingDBSettings Class Reference
+ Inheritance diagram for ilLoggingDBSettings:
+ Collaboration diagram for ilLoggingDBSettings:

Public Member Functions

 getLevelByComponent (string $a_component_id)
 Get level by component. More...
 
 isEnabled ()
 Check if logging is enabled. More...
 
 getLogDir ()
 
 getLogFile ()
 
 getLevel ()
 
 setLevel (int $a_level)
 
 setCacheLevel (int $a_level)
 
 getCacheLevel ()
 
 enableCaching (bool $a_status)
 
 isCacheEnabled ()
 
 enableMemoryUsage (bool $a_stat)
 
 isMemoryUsageEnabled ()
 
 isBrowserLogEnabled ()
 
 isBrowserLogEnabledForUser (string $a_login)
 
 enableBrowserLog (bool $a_stat)
 
 getBrowserLogUsers ()
 
 setBrowserUsers (array $users)
 
 update ()
 Update setting. More...
 

Static Public Member Functions

static getInstance ()
 

Protected Member Functions

 getStorage ()
 

Static Protected Attributes

static ilLoggingDBSettings $instance = null
 

Private Member Functions

 __construct ()
 
 read ()
 Read settings. More...
 

Private Attributes

bool $enabled = false
 
ilSetting $storage
 
int $level
 
bool $cache = false
 
int $cache_level
 
bool $memory_usage = false
 
bool $browser = false
 
array $browser_users = array()
 

Detailed Description

Definition at line 12 of file class.ilLoggingDBSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilLoggingDBSettings::__construct ( )
private

Definition at line 31 of file class.ilLoggingDBSettings.php.

References ilLogLevel\DEBUG, ilLogLevel\INFO, and read().

32  {
33  $this->enabled = (bool) ILIAS_LOG_ENABLED;
34  $this->level = ilLogLevel::INFO;
35  $this->cache_level = ilLogLevel::DEBUG;
36 
37  $this->storage = new ilSetting('logging');
38  $this->read();
39  }
+ Here is the call graph for this function:

Member Function Documentation

◆ enableBrowserLog()

ilLoggingDBSettings::enableBrowserLog ( bool  $a_stat)

Definition at line 150 of file class.ilLoggingDBSettings.php.

Referenced by read().

150  : void
151  {
152  $this->browser = $a_stat;
153  }
+ Here is the caller graph for this function:

◆ enableCaching()

ilLoggingDBSettings::enableCaching ( bool  $a_status)

Definition at line 113 of file class.ilLoggingDBSettings.php.

Referenced by read().

113  : void
114  {
115  $this->cache = $a_status;
116  }
+ Here is the caller graph for this function:

◆ enableMemoryUsage()

ilLoggingDBSettings::enableMemoryUsage ( bool  $a_stat)

Definition at line 123 of file class.ilLoggingDBSettings.php.

Referenced by read().

123  : void
124  {
125  $this->memory_usage = $a_stat;
126  }
+ Here is the caller graph for this function:

◆ getBrowserLogUsers()

ilLoggingDBSettings::getBrowserLogUsers ( )

Implements ilLoggingSettings.

Definition at line 155 of file class.ilLoggingDBSettings.php.

References $browser_users.

Referenced by isBrowserLogEnabledForUser(), and update().

155  : array
156  {
157  return $this->browser_users;
158  }
+ Here is the caller graph for this function:

◆ getCacheLevel()

ilLoggingDBSettings::getCacheLevel ( )

Implements ilLoggingSettings.

Definition at line 108 of file class.ilLoggingDBSettings.php.

References $cache_level.

Referenced by update().

108  : int
109  {
110  return $this->cache_level;
111  }
+ Here is the caller graph for this function:

◆ getInstance()

static ilLoggingDBSettings::getInstance ( )
static

Definition at line 41 of file class.ilLoggingDBSettings.php.

Referenced by ilLogComponentTableGUI\fillRow(), ilLoggerFactory\getInstance(), ilLogComponentTableGUI\init(), ilSimpleSAMLphpWrapper\initConfigFiles(), and ilObjLoggingSettingsGUI\initSettings().

41  : self
42  {
43  if (self::$instance) {
44  return self::$instance;
45  }
46  return self::$instance = new self();
47  }
+ Here is the caller graph for this function:

◆ getLevel()

ilLoggingDBSettings::getLevel ( )

Implements ilLoggingSettings.

Definition at line 93 of file class.ilLoggingDBSettings.php.

References $level.

Referenced by getLevelByComponent(), and update().

93  : int
94  {
95  return $this->level;
96  }
+ Here is the caller graph for this function:

◆ getLevelByComponent()

ilLoggingDBSettings::getLevelByComponent ( string  $a_component_id)

Get level by component.

Todo:
better performance

Implements ilLoggingSettings.

Definition at line 53 of file class.ilLoggingDBSettings.php.

References ilLogComponentLevels\getInstance(), and getLevel().

53  : int
54  {
55  $levels = ilLogComponentLevels::getInstance()->getLogComponents();
56  foreach ($levels as $level) {
57  if ($level->getComponentId() == $a_component_id) {
58  if ($level->getLevel()) {
59  return $level->getLevel();
60  }
61  }
62  }
63  return $this->getLevel();
64  }
+ Here is the call graph for this function:

◆ getLogDir()

ilLoggingDBSettings::getLogDir ( )

Implements ilLoggingSettings.

Definition at line 83 of file class.ilLoggingDBSettings.php.

83  : string
84  {
85  return ILIAS_LOG_DIR;
86  }

◆ getLogFile()

ilLoggingDBSettings::getLogFile ( )

Implements ilLoggingSettings.

Definition at line 88 of file class.ilLoggingDBSettings.php.

88  : string
89  {
90  return ILIAS_LOG_FILE;
91  }

◆ getStorage()

ilLoggingDBSettings::getStorage ( )
protected
Returns
ilSetting

Definition at line 69 of file class.ilLoggingDBSettings.php.

References $storage.

Referenced by read(), and update().

69  : ilSetting
70  {
71  return $this->storage;
72  }
+ Here is the caller graph for this function:

◆ isBrowserLogEnabled()

ilLoggingDBSettings::isBrowserLogEnabled ( )

Implements ilLoggingSettings.

Definition at line 133 of file class.ilLoggingDBSettings.php.

References $browser.

Referenced by isBrowserLogEnabledForUser(), and update().

133  : bool
134  {
135  return $this->browser;
136  }
+ Here is the caller graph for this function:

◆ isBrowserLogEnabledForUser()

ilLoggingDBSettings::isBrowserLogEnabledForUser ( string  $a_login)

Implements ilLoggingSettings.

Definition at line 139 of file class.ilLoggingDBSettings.php.

References getBrowserLogUsers(), and isBrowserLogEnabled().

139  : bool
140  {
141  if (!$this->isBrowserLogEnabled()) {
142  return false;
143  }
144  if (in_array($a_login, $this->getBrowserLogUsers())) {
145  return true;
146  }
147  return false;
148  }
+ Here is the call graph for this function:

◆ isCacheEnabled()

ilLoggingDBSettings::isCacheEnabled ( )

Implements ilLoggingSettings.

Definition at line 118 of file class.ilLoggingDBSettings.php.

References $cache.

Referenced by update().

118  : bool
119  {
120  return $this->cache;
121  }
+ Here is the caller graph for this function:

◆ isEnabled()

ilLoggingDBSettings::isEnabled ( )

Check if logging is enabled.

Returns
bool

Implements ilLoggingSettings.

Definition at line 78 of file class.ilLoggingDBSettings.php.

References $enabled.

78  : bool
79  {
80  return $this->enabled;
81  }

◆ isMemoryUsageEnabled()

ilLoggingDBSettings::isMemoryUsageEnabled ( )

Implements ilLoggingSettings.

Definition at line 128 of file class.ilLoggingDBSettings.php.

References $memory_usage.

Referenced by update().

128  : bool
129  {
130  return $this->memory_usage;
131  }
+ Here is the caller graph for this function:

◆ read()

ilLoggingDBSettings::read ( )
private

Read settings.

private

Definition at line 185 of file class.ilLoggingDBSettings.php.

References enableBrowserLog(), enableCaching(), enableMemoryUsage(), getStorage(), setBrowserUsers(), setCacheLevel(), and setLevel().

Referenced by __construct().

185  : void
186  {
187  $this->setLevel((int) $this->getStorage()->get('level', (string) $this->level));
188  $this->enableCaching((bool) $this->getStorage()->get('cache', (string) $this->cache));
189  $this->setCacheLevel((int) $this->getStorage()->get('cache_level', (string) $this->cache_level));
190  $this->enableMemoryUsage((bool) $this->getStorage()->get('memory_usage', (string) $this->memory_usage));
191  $this->enableBrowserLog((bool) $this->getStorage()->get('browser', (string) $this->browser));
192  $this->setBrowserUsers((array) unserialize($this->getStorage()->get('browser_users', serialize($this->browser_users))));
193  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setBrowserUsers()

ilLoggingDBSettings::setBrowserUsers ( array  $users)

Definition at line 160 of file class.ilLoggingDBSettings.php.

Referenced by read().

160  : void
161  {
162  $this->browser_users = $users;
163  }
+ Here is the caller graph for this function:

◆ setCacheLevel()

ilLoggingDBSettings::setCacheLevel ( int  $a_level)

Definition at line 103 of file class.ilLoggingDBSettings.php.

Referenced by read().

103  : void
104  {
105  $this->cache_level = $a_level;
106  }
+ Here is the caller graph for this function:

◆ setLevel()

ilLoggingDBSettings::setLevel ( int  $a_level)

Definition at line 98 of file class.ilLoggingDBSettings.php.

Referenced by read().

98  : void
99  {
100  $this->level = $a_level;
101  }
+ Here is the caller graph for this function:

◆ update()

ilLoggingDBSettings::update ( )

Update setting.

Definition at line 169 of file class.ilLoggingDBSettings.php.

References getBrowserLogUsers(), getCacheLevel(), getLevel(), getStorage(), isBrowserLogEnabled(), isCacheEnabled(), and isMemoryUsageEnabled().

169  : void
170  {
171  $this->getStorage()->set('level', (string) $this->getLevel());
172  $this->getStorage()->set('cache', (string) $this->isCacheEnabled());
173  $this->getStorage()->set('cache_level', (string) $this->getCacheLevel());
174  $this->getStorage()->set('memory_usage', (string) $this->isMemoryUsageEnabled());
175  $this->getStorage()->set('browser', (string) $this->isBrowserLogEnabled());
176  $this->getStorage()->set('browser_users', serialize($this->getBrowserLogUsers()));
177  }
+ Here is the call graph for this function:

Field Documentation

◆ $browser

bool ilLoggingDBSettings::$browser = false
private

Definition at line 23 of file class.ilLoggingDBSettings.php.

Referenced by isBrowserLogEnabled().

◆ $browser_users

array ilLoggingDBSettings::$browser_users = array()
private

Definition at line 27 of file class.ilLoggingDBSettings.php.

Referenced by getBrowserLogUsers().

◆ $cache

bool ilLoggingDBSettings::$cache = false
private

Definition at line 20 of file class.ilLoggingDBSettings.php.

Referenced by isCacheEnabled().

◆ $cache_level

int ilLoggingDBSettings::$cache_level
private

Definition at line 21 of file class.ilLoggingDBSettings.php.

Referenced by getCacheLevel().

◆ $enabled

bool ilLoggingDBSettings::$enabled = false
private

Definition at line 16 of file class.ilLoggingDBSettings.php.

Referenced by isEnabled().

◆ $instance

ilLoggingDBSettings ilLoggingDBSettings::$instance = null
staticprotected

Definition at line 14 of file class.ilLoggingDBSettings.php.

◆ $level

int ilLoggingDBSettings::$level
private

Definition at line 19 of file class.ilLoggingDBSettings.php.

Referenced by getLevel().

◆ $memory_usage

bool ilLoggingDBSettings::$memory_usage = false
private

Definition at line 22 of file class.ilLoggingDBSettings.php.

Referenced by isMemoryUsageEnabled().

◆ $storage

ilSetting ilLoggingDBSettings::$storage
private

Definition at line 17 of file class.ilLoggingDBSettings.php.

Referenced by getStorage().


The documentation for this class was generated from the following file: