ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC, $ilDB, ilLogLevel\DEBUG, ilLogLevel\INFO, and read().

41  {
42  global $DIC;
43 
44  $ilDB = $DIC['ilDB'];
45 
46 
47  $this->enabled = ILIAS_LOG_ENABLED;
48  $this->level = ilLogLevel::INFO;
49  $this->cache_level = ilLogLevel::DEBUG;
50 
51  $this->storage = new ilSetting('logging');
52  $this->read();
53  }
global $DIC
Definition: saml.php:7
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 213 of file class.ilLoggingDBSettings.php.

Referenced by read().

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

◆ enableCaching()

ilLoggingDBSettings::enableCaching (   $a_status)

Enable caching.

Parameters
type$a_status

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

Referenced by read().

156  {
157  $this->cache = $a_status;
158  }
+ 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 169 of file class.ilLoggingDBSettings.php.

Referenced by read().

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

◆ getBrowserLogUsers()

ilLoggingDBSettings::getBrowserLogUsers ( )

Implements ilLoggingSettings.

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

References $browser_users.

Referenced by isBrowserLogEnabledForUser(), and update().

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

◆ getCacheLevel()

ilLoggingDBSettings::getCacheLevel ( )

Get cache level.

Returns
type

Implements ilLoggingSettings.

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

References $cache_level.

Referenced by update().

147  {
148  return $this->cache_level;
149  }
+ 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 60 of file class.ilLoggingDBSettings.php.

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

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

◆ getLevel()

ilLoggingDBSettings::getLevel ( )

Get log level.

Returns
type

Implements ilLoggingSettings.

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

References $level.

Referenced by getLevelByComponent(), and update().

120  {
121  return $this->level;
122  }
+ 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 74 of file class.ilLoggingDBSettings.php.

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

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

◆ getLogDir()

ilLoggingDBSettings::getLogDir ( )

Implements ilLoggingSettings.

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

106  {
107  return ILIAS_LOG_DIR;
108  }

◆ getLogFile()

ilLoggingDBSettings::getLogFile ( )

Implements ilLoggingSettings.

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

111  {
112  return ILIAS_LOG_FILE;
113  }

◆ getStorage()

ilLoggingDBSettings::getStorage ( )
protected
Returns
ilSetting

Definition at line 91 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 187 of file class.ilLoggingDBSettings.php.

References $browser.

Referenced by isBrowserLogEnabledForUser(), and update().

188  {
189  return $this->browser;
190  }
+ 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 198 of file class.ilLoggingDBSettings.php.

References getBrowserLogUsers(), and isBrowserLogEnabled().

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

◆ isCacheEnabled()

ilLoggingDBSettings::isCacheEnabled ( )

Implements ilLoggingSettings.

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

References $cache.

Referenced by update().

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

◆ isEnabled()

ilLoggingDBSettings::isEnabled ( )

Check if logging is enabled.

Returns
type

Implements ilLoggingSettings.

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

References $enabled.

101  {
102  return $this->enabled;
103  }

◆ isMemoryUsageEnabled()

ilLoggingDBSettings::isMemoryUsageEnabled ( )

Check if loggin of memory usage is enabled.

Returns
type

Implements ilLoggingSettings.

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

References $memory_usage.

Referenced by update().

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

◆ read()

ilLoggingDBSettings::read ( )
private

Read settings.

private

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

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

Referenced by __construct().

249  {
250  $this->setLevel($this->getStorage()->get('level', $this->level));
251  $this->enableCaching($this->getStorage()->get('cache', $this->cache));
252  $this->setCacheLevel($this->getStorage()->get('cache_level', $this->cache_level));
253  $this->enableMemoryUsage($this->getStorage()->get('memory_usage', $this->memory_usage));
254  $this->enableBrowserLog($this->getStorage()->get('browser', $this->browser));
255  $this->setBrowserUsers(unserialize($this->getStorage()->get('browser_users', serialize($this->browser_users))));
256  }
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 223 of file class.ilLoggingDBSettings.php.

References $users.

Referenced by read().

224  {
225  $this->browser_users = $users;
226  }
$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 137 of file class.ilLoggingDBSettings.php.

Referenced by read().

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

◆ setLevel()

ilLoggingDBSettings::setLevel (   $a_level)

Set log level.

Parameters
type$a_level

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

Referenced by read().

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

◆ update()

ilLoggingDBSettings::update ( )

Update setting.

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

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

233  {
234  $this->getStorage()->set('level', $this->getLevel());
235  $this->getStorage()->set('cache', (int) $this->isCacheEnabled());
236  $this->getStorage()->set('cache_level', $this->getCacheLevel());
237  $this->getStorage()->set('memory_usage', $this->isMemoryUsageEnabled());
238  $this->getStorage()->set('browser', $this->isBrowserLogEnabled());
239  $this->getStorage()->set('browser_users', serialize($this->getBrowserLogUsers()));
240  }
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: