ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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...
 
 isEnabled ()
 
 getLogDir ()
 
 getLogFile ()
 
 getLevel ()
 
 getLevelByComponent (string $a_component_id)
 
 getCacheLevel ()
 
 isCacheEnabled ()
 
 isMemoryUsageEnabled ()
 
 isBrowserLogEnabled ()
 
 isBrowserLogEnabledForUser (string $a_login)
 
 getBrowserLogUsers ()
 

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

Constructor & Destructor Documentation

◆ __construct()

ilLoggingDBSettings::__construct ( )
private

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

46 {
47 $this->enabled = (bool) 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.

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

+ Here is the call graph for this function:

Member Function Documentation

◆ enableBrowserLog()

ilLoggingDBSettings::enableBrowserLog ( bool  $a_stat)

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

164 : void
165 {
166 $this->browser = $a_stat;
167 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableCaching()

ilLoggingDBSettings::enableCaching ( bool  $a_status)

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

127 : void
128 {
129 $this->cache = $a_status;
130 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableMemoryUsage()

ilLoggingDBSettings::enableMemoryUsage ( bool  $a_stat)

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

137 : void
138 {
139 $this->memory_usage = $a_stat;
140 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getBrowserLogUsers()

ilLoggingDBSettings::getBrowserLogUsers ( )

Implements ilLoggingSettings.

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

169 : array
170 {
172 }

References $browser_users.

Referenced by isBrowserLogEnabledForUser(), and update().

+ Here is the caller graph for this function:

◆ getCacheLevel()

ilLoggingDBSettings::getCacheLevel ( )

Implements ilLoggingSettings.

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

122 : int
123 {
124 return $this->cache_level;
125 }

References $cache_level.

Referenced by update().

+ Here is the caller graph for this function:

◆ getInstance()

static ilLoggingDBSettings::getInstance ( )
static

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

55 : self
56 {
57 if (self::$instance) {
58 return self::$instance;
59 }
60 return self::$instance = new self();
61 }
static ilLoggingDBSettings $instance

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

Implements ilLoggingSettings.

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

107 : int
108 {
109 return $this->level;
110 }

References $level.

Referenced by getLevelByComponent(), and update().

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

67 : int
68 {
69 $levels = ilLogComponentLevels::getInstance()->getLogComponents();
70 foreach ($levels as $level) {
71 if ($level->getComponentId() == $a_component_id) {
72 if ($level->getLevel()) {
73 return $level->getLevel();
74 }
75 }
76 }
77 return $this->getLevel();
78 }

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

+ Here is the call graph for this function:

◆ getLogDir()

ilLoggingDBSettings::getLogDir ( )

Implements ilLoggingSettings.

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

97 : string
98 {
99 return ILIAS_LOG_DIR;
100 }

◆ getLogFile()

ilLoggingDBSettings::getLogFile ( )

Implements ilLoggingSettings.

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

102 : string
103 {
104 return ILIAS_LOG_FILE;
105 }

◆ getStorage()

ilLoggingDBSettings::getStorage ( )
protected
Returns
ilSetting

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

83 : ilSetting
84 {
85 return $this->storage;
86 }

References $storage.

Referenced by read(), and update().

+ Here is the caller graph for this function:

◆ isBrowserLogEnabled()

ilLoggingDBSettings::isBrowserLogEnabled ( )

Implements ilLoggingSettings.

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

147 : bool
148 {
149 return $this->browser;
150 }

References $browser.

Referenced by isBrowserLogEnabledForUser(), and update().

+ Here is the caller graph for this function:

◆ isBrowserLogEnabledForUser()

ilLoggingDBSettings::isBrowserLogEnabledForUser ( string  $a_login)

Implements ilLoggingSettings.

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

153 : bool
154 {
155 if (!$this->isBrowserLogEnabled()) {
156 return false;
157 }
158 if (in_array($a_login, $this->getBrowserLogUsers())) {
159 return true;
160 }
161 return false;
162 }

References getBrowserLogUsers(), and isBrowserLogEnabled().

+ Here is the call graph for this function:

◆ isCacheEnabled()

ilLoggingDBSettings::isCacheEnabled ( )

Implements ilLoggingSettings.

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

132 : bool
133 {
134 return $this->cache;
135 }

References $cache.

Referenced by update().

+ Here is the caller graph for this function:

◆ isEnabled()

ilLoggingDBSettings::isEnabled ( )

Check if logging is enabled.

Returns
bool

Implements ilLoggingSettings.

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

92 : bool
93 {
94 return $this->enabled;
95 }

References $enabled.

◆ isMemoryUsageEnabled()

ilLoggingDBSettings::isMemoryUsageEnabled ( )

Implements ilLoggingSettings.

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

142 : bool
143 {
144 return $this->memory_usage;
145 }

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

199 : void
200 {
201 $this->setLevel((int) $this->getStorage()->get('level', (string) $this->level));
202 $this->enableCaching((bool) $this->getStorage()->get('cache', (string) $this->cache));
203 $this->setCacheLevel((int) $this->getStorage()->get('cache_level', (string) $this->cache_level));
204 $this->enableMemoryUsage((bool) $this->getStorage()->get('memory_usage', (string) $this->memory_usage));
205 $this->enableBrowserLog((bool) $this->getStorage()->get('browser', (string) $this->browser));
206 $this->setBrowserUsers((array) unserialize($this->getStorage()->get('browser_users', serialize($this->browser_users))));
207 }

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

174 : void
175 {
176 $this->browser_users = $users;
177 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setCacheLevel()

ilLoggingDBSettings::setCacheLevel ( int  $a_level)

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

117 : void
118 {
119 $this->cache_level = $a_level;
120 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLevel()

ilLoggingDBSettings::setLevel ( int  $a_level)

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

112 : void
113 {
114 $this->level = $a_level;
115 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilLoggingDBSettings::update ( )

Update setting.

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

183 : void
184 {
185 $this->getStorage()->set('level', (string) $this->getLevel());
186 $this->getStorage()->set('cache', (string) $this->isCacheEnabled());
187 $this->getStorage()->set('cache_level', (string) $this->getCacheLevel());
188 $this->getStorage()->set('memory_usage', (string) $this->isMemoryUsageEnabled());
189 $this->getStorage()->set('browser', (string) $this->isBrowserLogEnabled());
190 $this->getStorage()->set('browser_users', serialize($this->getBrowserLogUsers()));
191 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $browser

bool ilLoggingDBSettings::$browser = false
private

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

Referenced by isBrowserLogEnabled().

◆ $browser_users

array ilLoggingDBSettings::$browser_users = array()
private

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

Referenced by getBrowserLogUsers().

◆ $cache

bool ilLoggingDBSettings::$cache = false
private

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

Referenced by isCacheEnabled().

◆ $cache_level

int ilLoggingDBSettings::$cache_level
private

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

Referenced by getCacheLevel().

◆ $enabled

bool ilLoggingDBSettings::$enabled = false
private

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

Referenced by isEnabled().

◆ $instance

ilLoggingDBSettings ilLoggingDBSettings::$instance = null
staticprotected

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

Referenced by getInstance().

◆ $level

int ilLoggingDBSettings::$level
private

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

Referenced by getLevel(), and getLevelByComponent().

◆ $memory_usage

bool ilLoggingDBSettings::$memory_usage = false
private

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

Referenced by isMemoryUsageEnabled().

◆ $storage

ilSetting ilLoggingDBSettings::$storage
private

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

Referenced by getStorage().


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