10 defined(
'JPATH_PLATFORM') or die;
30 protected $priorities = array(
47 public function __construct(array &$options)
50 parent::__construct($options);
53 if (empty($this->options[
'sys_ident']))
55 $this->options[
'sys_ident'] =
'Joomla Platform';
59 if (isset($this->options[
'sys_add_pid']))
61 $this->options[
'sys_add_pid'] = (bool) $this->options[
'sys_add_pid'];
65 $this->options[
'sys_add_pid'] =
true;
69 if (isset($this->options[
'sys_use_stderr']))
71 $this->options[
'sys_use_stderr'] = (bool) $this->options[
'sys_use_stderr'];
75 $this->options[
'sys_use_stderr'] =
false;
81 if ($this->options[
'sys_add_pid'])
83 $sysOptions = $sysOptions | LOG_PID;
85 if ($this->options[
'sys_use_stderr'])
87 $sysOptions = $sysOptions | LOG_PERROR;
91 $sysFacility = LOG_USER;
94 if (isset($this->options[
'sys_facility']) && !IS_WIN)
96 $sysFacility = $this->options[
'sys_facility'];
100 openlog((
string) $this->options[
'sys_ident'], $sysOptions, $sysFacility);
108 public function __destruct()
125 $priority = constant(strtoupper(
'LOG_' . $this->priorities[$entry->priority]));
128 syslog($priority,
'[' . $entry->category .
'] ' . $entry->message);