ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
 __construct ($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 16 of file class.ilWACLog.php.

Constructor & Destructor Documentation

◆ __destruct()

ilWACLog::__destruct ( )

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

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

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

Member Function Documentation

◆ getInstance()

static ilWACLog::getInstance ( )
static
Returns
ilWACLog

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

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

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

40  {
41  $key = getmypid();
42  if (ilWebAccessChecker::isDEBUG() && defined('ILIAS_ABSOLUTE_PATH')) {
43  $ilIliasIniFile = new ilIniFile('./ilias.ini.php');
44  $ilIliasIniFile->read();
46  $instance = new self($ilIliasIniFile->readVariable('log', 'path'), self::WAC_LOG, 'WAC');
47  } else {
48  $instance = new self($ilIliasIniFile->readVariable('log', 'path'), $ilIliasIniFile->readVariable('log', 'file'), 'WAC');
49  }
50  $instance->setPid($key);
51  self::$instances[$key] = $instance;
52  } else {
53  self::$instances[$key] = new ilWACLogDummy();
54  }
55 
56  return self::$instances[$key];
57  }
Class ilWACLogDummy.
$ilIliasIniFile
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
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 94 of file class.ilWACLog.php.

References $pid.

Referenced by __destruct().

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

◆ getStack()

ilWACLog::getStack ( )
Returns
array

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

References $stack.

Referenced by __destruct().

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

◆ setPid()

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

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

References $pid.

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

◆ setStack()

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

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

References $stack.

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

◆ write()

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

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

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

Field Documentation

◆ $instances

ilWACLog::$instances = array()
staticprotected

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

◆ $is_dummy

ilWACLog::$is_dummy = false
protected

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

◆ $pid

ilWACLog::$pid = 0
protected

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

Referenced by getPid(), and setPid().

◆ $stack

ilWACLog::$stack = array()
protected

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

Referenced by getStack(), and setStack().

◆ WAC_LOG

const ilWACLog::WAC_LOG = 'wac.log'

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


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