ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilLoggingDBSettings Class Reference
+ Inheritance diagram for ilLoggingDBSettings:
+ Collaboration diagram for ilLoggingDBSettings:

Public Member Functions

 getLevelByComponent ($a_component_id)
 Get level by component. More...
 
 isEnabled ()
 Check if logging is enabled. More...
 
 getLogDir ()
 
 getLogFile ()
 
 getLevel ()
 Get log level. More...
 
 setLevel ($a_level)
 Set log level. More...
 
 setCacheLevel ($a_level)
 Set cache level. More...
 
 getCacheLevel ()
 Get cache level. More...
 
 enableCaching ($a_status)
 Enable caching. More...
 
 isCacheEnabled ()
 
 enableMemoryUsage ($a_stat)
 Enable logging of memory usage. More...
 
 isMemoryUsageEnabled ()
 Check if loggin of memory usage is enabled. More...
 
 isBrowserLogEnabled ()
 Check if browser log is enabled. More...
 
 isBrowserLogEnabledForUser ($a_login)
 Check if browser log is enabled for user. More...
 
 enableBrowserLog ($a_stat)
 Enable browser log. More...
 
 getBrowserLogUsers ()
 
 setBrowserUsers (array $users)
 
 update ()
 Update setting. More...
 

Static Public Member Functions

static getInstance ()
 Get instance. More...
 

Protected Member Functions

 getStorage ()
 

Static Protected Attributes

static $instance = null
 

Private Member Functions

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

Private Attributes

 $enabled = false
 
 $storage = null
 
 $level = null
 
 $cache = false
 
 $cache_level = null
 
 $memory_usage = false
 
 $browser = false
 
 $browser_users = array()
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilLoggingDBSettings::__construct ( )
private

Singleton contructor.

private

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

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

41  {
42  global $ilDB;
43 
44 
45  $this->enabled = ILIAS_LOG_ENABLED;
46  $this->level = ilLogLevel::INFO;
47  $this->cache_level = ilLogLevel::DEBUG;
48 
49  $this->storage = new ilSetting('logging');
50  $this->read();
51  }
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ enableBrowserLog()

ilLoggingDBSettings::enableBrowserLog (   $a_stat)

Enable browser log.

Parameters
type$a_stat

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

Referenced by read().

212  {
213  $this->browser = $a_stat;
214  }
+ Here is the caller graph for this function:

◆ enableCaching()

ilLoggingDBSettings::enableCaching (   $a_status)

Enable caching.

Parameters
type$a_status

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

Referenced by read().

154  {
155  $this->cache = $a_status;
156  }
+ Here is the caller graph for this function:

◆ enableMemoryUsage()

ilLoggingDBSettings::enableMemoryUsage (   $a_stat)

Enable logging of memory usage.

Parameters
type$a_stat

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

Referenced by read().

168  {
169  $this->memory_usage = $a_stat;
170  }
+ Here is the caller graph for this function:

◆ getBrowserLogUsers()

ilLoggingDBSettings::getBrowserLogUsers ( )

Implements ilLoggingSettings.

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

References $browser_users.

Referenced by isBrowserLogEnabledForUser(), and update().

217  {
218  return $this->browser_users;
219  }
+ Here is the caller graph for this function:

◆ getCacheLevel()

ilLoggingDBSettings::getCacheLevel ( )

Get cache level.

Returns
type

Implements ilLoggingSettings.

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

References $cache_level.

Referenced by update().

145  {
146  return $this->cache_level;
147  }
+ Here is the caller graph for this function:

◆ getInstance()

static ilLoggingDBSettings::getInstance ( )
static

Get instance.

Parameters
int$a_server_id
Returns
ilLoggingDBSettings

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

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

59  {
60  if (self::$instance) {
61  return self::$instance;
62  }
63  return self::$instance = new self();
64  }
+ Here is the caller graph for this function:

◆ getLevel()

ilLoggingDBSettings::getLevel ( )

Get log level.

Returns
type

Implements ilLoggingSettings.

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

References $level.

Referenced by getLevelByComponent(), and update().

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

◆ getLevelByComponent()

ilLoggingDBSettings::getLevelByComponent (   $a_component_id)

Get level by component.

Parameters
type$a_component_id
Returns
type
Todo:
better performance

Implements ilLoggingSettings.

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

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

73  {
74  include_once './Services/Logging/classes/class.ilLogComponentLevels.php';
75  $levels = ilLogComponentLevels::getInstance()->getLogComponents();
76  foreach ($levels as $level) {
77  if ($level->getComponentId() == $a_component_id) {
78  if ($level->getLevel()) {
79  return $level->getLevel();
80  }
81  }
82  }
83  return $this->getLevel();
84  }
+ Here is the call graph for this function:

◆ getLogDir()

ilLoggingDBSettings::getLogDir ( )

Implements ilLoggingSettings.

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

104  {
105  return ILIAS_LOG_DIR;
106  }

◆ getLogFile()

ilLoggingDBSettings::getLogFile ( )

Implements ilLoggingSettings.

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

109  {
110  return ILIAS_LOG_FILE;
111  }

◆ getStorage()

ilLoggingDBSettings::getStorage ( )
protected
Returns
ilSetting

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

References $storage.

Referenced by read(), and update().

+ Here is the caller graph for this function:

◆ isBrowserLogEnabled()

ilLoggingDBSettings::isBrowserLogEnabled ( )

Check if browser log is enabled.

Returns
type

Implements ilLoggingSettings.

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

References $browser.

Referenced by isBrowserLogEnabledForUser(), and update().

186  {
187  return $this->browser;
188  }
+ Here is the caller graph for this function:

◆ isBrowserLogEnabledForUser()

ilLoggingDBSettings::isBrowserLogEnabledForUser (   $a_login)

Check if browser log is enabled for user.

Parameters
type$a_login
Returns
boolean

Implements ilLoggingSettings.

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

References getBrowserLogUsers(), and isBrowserLogEnabled().

197  {
198  if (!$this->isBrowserLogEnabled()) {
199  return false;
200  }
201  if (in_array($a_login, $this->getBrowserLogUsers())) {
202  return true;
203  }
204  return false;
205  }
isBrowserLogEnabled()
Check if browser log is enabled.
+ Here is the call graph for this function:

◆ isCacheEnabled()

ilLoggingDBSettings::isCacheEnabled ( )

Implements ilLoggingSettings.

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

References $cache.

Referenced by update().

159  {
160  return $this->cache;
161  }
+ Here is the caller graph for this function:

◆ isEnabled()

ilLoggingDBSettings::isEnabled ( )

Check if logging is enabled.

Returns
type

Implements ilLoggingSettings.

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

References $enabled.

99  {
100  return $this->enabled;
101  }

◆ isMemoryUsageEnabled()

ilLoggingDBSettings::isMemoryUsageEnabled ( )

Check if loggin of memory usage is enabled.

Returns
type

Implements ilLoggingSettings.

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

References $memory_usage.

Referenced by update().

177  {
178  return $this->memory_usage;
179  }
+ Here is the caller graph for this function:

◆ read()

ilLoggingDBSettings::read ( )
private

Read settings.

private

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

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

Referenced by __construct().

247  {
248  $this->setLevel($this->getStorage()->get('level', $this->level));
249  $this->enableCaching($this->getStorage()->get('cache', $this->cache));
250  $this->setCacheLevel($this->getStorage()->get('cache_level', $this->cache_level));
251  $this->enableMemoryUsage($this->getStorage()->get('memory_usage', $this->memory_usage));
252  $this->enableBrowserLog($this->getStorage()->get('browser', $this->browser));
253  $this->setBrowserUsers(unserialize($this->getStorage()->get('browser_users', serialize($this->browser_users))));
254  }
setCacheLevel($a_level)
Set cache level.
setLevel($a_level)
Set log level.
enableMemoryUsage($a_stat)
Enable logging of memory usage.
enableCaching($a_status)
Enable caching.
enableBrowserLog($a_stat)
Enable browser log.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setBrowserUsers()

ilLoggingDBSettings::setBrowserUsers ( array  $users)

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

References $users.

Referenced by read().

222  {
223  $this->browser_users = $users;
224  }
$users
Definition: authpage.php:44
+ Here is the caller graph for this function:

◆ setCacheLevel()

ilLoggingDBSettings::setCacheLevel (   $a_level)

Set cache level.

Parameters
type$a_level

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

Referenced by read().

136  {
137  $this->cache_level = $a_level;
138  }
+ Here is the caller graph for this function:

◆ setLevel()

ilLoggingDBSettings::setLevel (   $a_level)

Set log level.

Parameters
type$a_level

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

Referenced by read().

127  {
128  $this->level = $a_level;
129  }
+ Here is the caller graph for this function:

◆ update()

ilLoggingDBSettings::update ( )

Update setting.

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

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

231  {
232  $this->getStorage()->set('level', $this->getLevel());
233  $this->getStorage()->set('cache', (int) $this->isCacheEnabled());
234  $this->getStorage()->set('cache_level', $this->getCacheLevel());
235  $this->getStorage()->set('memory_usage', $this->isMemoryUsageEnabled());
236  $this->getStorage()->set('browser', $this->isBrowserLogEnabled());
237  $this->getStorage()->set('browser_users', serialize($this->getBrowserLogUsers()));
238  }
isMemoryUsageEnabled()
Check if loggin of memory usage is enabled.
isBrowserLogEnabled()
Check if browser log is enabled.
getCacheLevel()
Get cache level.
+ Here is the call graph for this function:

Field Documentation

◆ $browser

ilLoggingDBSettings::$browser = false
private

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

Referenced by isBrowserLogEnabled().

◆ $browser_users

ilLoggingDBSettings::$browser_users = array()
private

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

Referenced by getBrowserLogUsers().

◆ $cache

ilLoggingDBSettings::$cache = false
private

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

Referenced by isCacheEnabled().

◆ $cache_level

ilLoggingDBSettings::$cache_level = null
private

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

Referenced by getCacheLevel().

◆ $enabled

ilLoggingDBSettings::$enabled = false
private

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

Referenced by isEnabled().

◆ $instance

ilLoggingDBSettings::$instance = null
staticprotected

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

◆ $level

ilLoggingDBSettings::$level = null
private

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

Referenced by getLevel(), and getLevelByComponent().

◆ $memory_usage

ilLoggingDBSettings::$memory_usage = false
private

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

Referenced by isMemoryUsageEnabled().

◆ $storage

ilLoggingDBSettings::$storage = null
private

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

Referenced by getStorage().


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