ILIAS  release_7 Revision v7.30-3-g800a261c036
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...
 
 isEnabled ()
 
 getLogDir ()
 
 getLogFile ()
 
 getLevel ()
 
 getLevelByComponent ($a_component_id)
 
 getCacheLevel ()
 
 isCacheEnabled ()
 
 isMemoryUsageEnabled ()
 
 isBrowserLogEnabled ()
 
 isBrowserLogEnabledForUser ($a_login)
 
 getBrowserLogUsers ()
 

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.

@access private

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

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 }
ILIAS Setting Class.
global $DIC
Definition: goto.php:24
global $ilDB

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

+ 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.

214 {
215 $this->browser = $a_stat;
216 }

Referenced by read().

+ 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.

156 {
157 $this->cache = $a_status;
158 }

Referenced by read().

+ 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.

170 {
171 $this->memory_usage = $a_stat;
172 }

Referenced by read().

+ 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().

+ 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().

+ 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.

61 {
62 if (self::$instance) {
63 return self::$instance;
64 }
65 return self::$instance = new self();
66 }

References $instance.

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

+ 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().

+ 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.

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 }

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

+ 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().

+ 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.

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.

References getBrowserLogUsers(), and isBrowserLogEnabled().

+ 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().

+ 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.

◆ 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().

+ Here is the caller graph for this function:

◆ read()

ilLoggingDBSettings::read ( )
private

Read settings.

@access private

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

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 }
setLevel($a_level)
Set log level.
enableCaching($a_status)
Enable caching.
enableMemoryUsage($a_stat)
Enable logging of memory usage.
enableBrowserLog($a_stat)
Enable browser log.
setCacheLevel($a_level)
Set cache level.

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

Referenced by __construct().

+ 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.

224 {
225 $this->browser_users = $users;
226 }

Referenced by read().

+ 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.

138 {
139 $this->cache_level = $a_level;
140 }

Referenced by read().

+ 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.

129 {
130 $this->level = $a_level;
131 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilLoggingDBSettings::update ( )

Update setting.

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

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.

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

+ 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.

Referenced by getInstance().

◆ $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: