ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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...
 

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.

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

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

Referenced by read().

164  : void
165  {
166  $this->browser = $a_stat;
167  }
+ Here is the caller graph for this function:

◆ enableCaching()

ilLoggingDBSettings::enableCaching ( bool  $a_status)

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

Referenced by read().

127  : void
128  {
129  $this->cache = $a_status;
130  }
+ Here is the caller graph for this function:

◆ enableMemoryUsage()

ilLoggingDBSettings::enableMemoryUsage ( bool  $a_stat)

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

Referenced by read().

137  : void
138  {
139  $this->memory_usage = $a_stat;
140  }
+ Here is the caller graph for this function:

◆ getBrowserLogUsers()

ilLoggingDBSettings::getBrowserLogUsers ( )

Implements ilLoggingSettings.

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

References $browser_users.

Referenced by isBrowserLogEnabledForUser(), and update().

169  : array
170  {
171  return $this->browser_users;
172  }
+ Here is the caller graph for this function:

◆ getCacheLevel()

ilLoggingDBSettings::getCacheLevel ( )

Implements ilLoggingSettings.

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

References $cache_level.

Referenced by update().

122  : int
123  {
124  return $this->cache_level;
125  }
+ Here is the caller graph for this function:

◆ getInstance()

static ilLoggingDBSettings::getInstance ( )
static

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

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

55  : self
56  {
57  if (self::$instance) {
58  return self::$instance;
59  }
60  return self::$instance = new self();
61  }
+ Here is the caller graph for this function:

◆ getLevel()

ilLoggingDBSettings::getLevel ( )

Implements ilLoggingSettings.

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

References $level.

Referenced by getLevelByComponent(), and update().

107  : int
108  {
109  return $this->level;
110  }
+ 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.

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

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

References $storage.

Referenced by read(), and update().

83  : ilSetting
84  {
85  return $this->storage;
86  }
+ Here is the caller graph for this function:

◆ isBrowserLogEnabled()

ilLoggingDBSettings::isBrowserLogEnabled ( )

Implements ilLoggingSettings.

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

References $browser.

Referenced by isBrowserLogEnabledForUser(), and update().

147  : bool
148  {
149  return $this->browser;
150  }
+ 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.

References getBrowserLogUsers(), and isBrowserLogEnabled().

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  }
+ Here is the call graph for this function:

◆ isCacheEnabled()

ilLoggingDBSettings::isCacheEnabled ( )

Implements ilLoggingSettings.

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

References $cache.

Referenced by update().

132  : bool
133  {
134  return $this->cache;
135  }
+ 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.

References $enabled.

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

◆ isMemoryUsageEnabled()

ilLoggingDBSettings::isMemoryUsageEnabled ( )

Implements ilLoggingSettings.

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

References $memory_usage.

Referenced by update().

142  : bool
143  {
144  return $this->memory_usage;
145  }
+ Here is the caller graph for this function:

◆ read()

ilLoggingDBSettings::read ( )
private

Read settings.

private

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

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

Referenced by __construct().

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

Referenced by read().

174  : void
175  {
176  $this->browser_users = $users;
177  }
+ Here is the caller graph for this function:

◆ setCacheLevel()

ilLoggingDBSettings::setCacheLevel ( int  $a_level)

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

Referenced by read().

117  : void
118  {
119  $this->cache_level = $a_level;
120  }
+ Here is the caller graph for this function:

◆ setLevel()

ilLoggingDBSettings::setLevel ( int  $a_level)

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

Referenced by read().

112  : void
113  {
114  $this->level = $a_level;
115  }
+ Here is the caller graph for this function:

◆ update()

ilLoggingDBSettings::update ( )

Update setting.

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

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

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

◆ $level

int ilLoggingDBSettings::$level
private

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

Referenced by getLevel().

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