@@ -54,8 +54,15 @@
* @var string
* @access private
*/
var $_timeFormat = '%b %d %H:%M:%S';
+
+ /**
+ * String containing the end-on-line character sequence.
+ * @var string
+ * @access private
+ */
+ var $_eol = "\n";
/**
* Constructs a new Log_error_log object.
*
@@ -88,8 +95,14 @@
}
if (!empty($conf['timeFormat'])) {
$this->_timeFormat = $conf['timeFormat'];
+ }
+
+ if (!empty($conf['eol'])) {
+ $this->_eol = $conf['eol'];
+ } else {
+ $this->_eol = (strstr(PHP_OS, 'WIN')) ? "\r\n" : "\n";
}
}
/**
@@ -145,9 +158,9 @@
/* Build the string containing the complete log line. */
$line = $this->_format($this->_lineFormat,
strftime($this->_timeFormat),
- $priority, $message);
+ $priority, $message) . $this->_eol;
/* Pass the log line and parameters to the error_log() function. */
$success = error_log($line, $this->_type, $this->_destination,
$this->_extra_headers);