ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 $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 }
ILIAS Setting Class.
global $ilDB

References $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 217 of file class.ilLoggingDBSettings.php.

218 {
219 $this->browser = $a_stat;
220 }

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 157 of file class.ilLoggingDBSettings.php.

158 {
159 $this->cache = $a_status;
160 }

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 171 of file class.ilLoggingDBSettings.php.

172 {
173 $this->memory_usage = $a_stat;
174 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getBrowserLogUsers()

ilLoggingDBSettings::getBrowserLogUsers ( )

Implements ilLoggingSettings.

Definition at line 222 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 148 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 58 of file class.ilLoggingDBSettings.php.

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

References $instance.

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

+ Here is the caller graph for this function:

◆ getLevel()

ilLoggingDBSettings::getLevel ( )

Get log level.

Returns
type

Implements ilLoggingSettings.

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

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

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

+ Here is the call graph for this function:

◆ getLogDir()

ilLoggingDBSettings::getLogDir ( )

Implements ilLoggingSettings.

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

108 {
109 return ILIAS_LOG_DIR;
110 }

◆ getLogFile()

ilLoggingDBSettings::getLogFile ( )

Implements ilLoggingSettings.

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

113 {
114 return ILIAS_LOG_FILE;
115 }

◆ getStorage()

ilLoggingDBSettings::getStorage ( )
protected
Returns
ilSetting

Definition at line 93 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 189 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 200 of file class.ilLoggingDBSettings.php.

201 {
202 if(!$this->isBrowserLogEnabled())
203 {
204 return FALSE;
205 }
206 if(in_array($a_login, $this->getBrowserLogUsers()))
207 {
208 return TRUE;
209 }
210 return FALSE;
211 }
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 162 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 102 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 180 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 252 of file class.ilLoggingDBSettings.php.

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

228 {
229 $this->browser_users = $users;
230 }

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 139 of file class.ilLoggingDBSettings.php.

140 {
141 $this->cache_level = $a_level;
142 }

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 130 of file class.ilLoggingDBSettings.php.

131 {
132 $this->level = $a_level;
133 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilLoggingDBSettings::update ( )

Update setting.

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

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