ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilWACLog Class Reference

Class ilWACLog. More...

+ Inheritance diagram for ilWACLog:
+ Collaboration diagram for ilWACLog:

Public Member Functions

 __destruct ()
 
 write ($a_msg, $a_log_level=null)
 
 getPid ()
 
 setPid ($pid)
 
 getStack ()
 
 setStack ($stack)
 
- Public Member Functions inherited from ilLog
 ilLog ($a_log_path, $a_log_file, $a_tag="", $a_enabled=true, $a_log_level=NULL)
 constructor More...
 
 setLogLevel ($a_log_level)
 set global log level More...
 
 checkLogLevel ($a_log_level)
 determine log level More...
 
 setLogFormat ($a_format)
 
 getLogFormat ()
 
 setPath ($a_str)
 
 setFilename ($a_str)
 
 setTag ($a_str)
 
 writeLanguageLog ($a_topic, $a_lang_key)
 special language checking routine More...
 
 writeWarning ($a_message)
 special warning message More...
 
 logError ($a_code, $a_msg)
 this function is automatically called by class.ilErrorHandler in case of an error To log manually please use $this::write public More...
 
 write ($a_msg, $a_log_level=NULL)
 logging More...
 
 logStack ($a_message='')
 
 dump ($a_var, $a_log_level=NULL)
 Dump a variable to the log. More...
 
 __destruct ()
 
 delete ()
 delete logfile More...
 

Static Public Member Functions

static getInstance ()
 

Data Fields

const WAC_LOG = 'wac.log'
 
- Data Fields inherited from ilLog
 $path
 
 $filename
 
 $tag
 
 $log_format
 
 $FATAL
 
 $WARNING
 
 $MESSAGE
 
 $fp = false
 

Protected Attributes

 $stack = array()
 
 $pid = 0
 
 $is_dummy = false
 

Static Protected Attributes

static $instances = array()
 

Detailed Description

Class ilWACLog.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

Since the ilLoggerFactory need ILIAS to be initialized, the WebAccessChecker can't use it at the moment. Logging is disabled by default and can be activated with ilWebAccessChecker::setDEBUG(true);

Definition at line 15 of file class.ilWACLog.php.

Constructor & Destructor Documentation

◆ __destruct()

ilWACLog::__destruct ( )

Definition at line 59 of file class.ilWACLog.php.

References $_SERVER, $ilUser, getPid(), and getStack().

59  {
60  if ($this->getStack()) {
61  global $ilUser;
62  parent::write('WebAccessChecker Request ' . str_repeat('#', 50));
63  parent::write('PID: ' . $this->getPid());
64  if (isset($_SERVER['HTTP_USER_AGENT'])) {
65  parent::write('User-Agent: ' . $_SERVER['HTTP_USER_AGENT']);
66  }
67  if (isset($_SERVER['HTTP_COOKIE'])) {
68  parent::write('Cookies: ' . $_SERVER['HTTP_COOKIE']);
69  }
70  if ($ilUser instanceof ilObjUser) {
71  parent::write('User_ID: ' . $ilUser->getId());
72  }
73  // parent::write('SERVER: ' . print_r($_SERVER, true));
74  foreach ($this->getStack() as $msg) {
75  parent::write($msg);
76  }
77  }
78  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

Member Function Documentation

◆ getInstance()

static ilWACLog::getInstance ( )
static
Returns
ilWACLog

Definition at line 39 of file class.ilWACLog.php.

References $ilIliasIniFile, ilWebAccessChecker\isDEBUG(), and ilWebAccessChecker\isUseSeperateLogfile().

Referenced by ilWACException\__construct(), ilWebAccessChecker\check(), ilWebAccessChecker\checkPublicSection(), ilWACSignedPath\checkToken(), ilFileDelivery\clearBuffer(), ilWebAccessCheckerDelivery\deliver(), ilFileDelivery\detemineDeliveryType(), ilWebAccessChecker\initILIAS(), ilWACSecurePath\returnDbTableName(), ilWACSignedPath\revalidatingFolderToken(), and ilWACSignedPath\saveFolderToken().

39  {
40  $key = getmypid();
42  $ilIliasIniFile = new ilIniFile('./ilias.ini.php');
43  $ilIliasIniFile->read();
45  $instance = new self($ilIliasIniFile->readVariable('log', 'path'), self::WAC_LOG, 'WAC');
46  } else {
47  $instance = new self($ilIliasIniFile->readVariable('log', 'path'), $ilIliasIniFile->readVariable('log', 'file'), 'WAC');
48  }
49  $instance->setPid($key);
50  self::$instances[$key] = $instance;
51  } else {
52  self::$instances[$key] = new ilWACLogDummy();
53  }
54 
55  return self::$instances[$key];
56  }
Class ilWACLogDummy.
global $ilIliasIniFile
INIFile Parser.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPid()

ilWACLog::getPid ( )
Returns
int

Definition at line 93 of file class.ilWACLog.php.

References $pid.

Referenced by __destruct().

93  {
94  return $this->pid;
95  }
+ Here is the caller graph for this function:

◆ getStack()

ilWACLog::getStack ( )
Returns
array

Definition at line 109 of file class.ilWACLog.php.

References $stack.

Referenced by __destruct().

109  {
110  return $this->stack;
111  }
+ Here is the caller graph for this function:

◆ setPid()

ilWACLog::setPid (   $pid)
Parameters
int$pid

Definition at line 101 of file class.ilWACLog.php.

References $pid.

101  {
102  $this->pid = $pid;
103  }

◆ setStack()

ilWACLog::setStack (   $stack)
Parameters
array$stack

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

References $stack.

117  {
118  $this->stack = $stack;
119  }

◆ write()

ilWACLog::write (   $a_msg,
  $a_log_level = null 
)
Parameters
$a_msg
null$a_log_level

Definition at line 85 of file class.ilWACLog.php.

85  {
86  $this->stack[] = $a_msg;
87  }

Field Documentation

◆ $instances

ilWACLog::$instances = array()
staticprotected

Definition at line 25 of file class.ilWACLog.php.

◆ $is_dummy

ilWACLog::$is_dummy = false
protected

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

◆ $pid

ilWACLog::$pid = 0
protected

Definition at line 29 of file class.ilWACLog.php.

Referenced by getPid(), and setPid().

◆ $stack

ilWACLog::$stack = array()
protected

Definition at line 21 of file class.ilWACLog.php.

Referenced by getStack(), and setStack().

◆ WAC_LOG

const ilWACLog::WAC_LOG = 'wac.log'

Definition at line 17 of file class.ilWACLog.php.


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