diff --git a/logger.php b/logger.php index 0c56662..321b4d0 100644 --- a/logger.php +++ b/logger.php @@ -31,6 +31,9 @@ class logger public $syslogFacility = LOG_USER; /** In Syslog, prefix the log by the text */ public $syslogPrefix = FALSE; + /** Remove X entries of backtrace to see the right file generating the error + */ + public $backTraceSkip = 0; /** The priorities which can be used in the priorities LOG_EMERG system is unusable @@ -60,7 +63,8 @@ class logger if ($this->loglevelmin < $priority) return; $backtrace = debug_backtrace(); - $back = reset ($backtrace); + for ($i = 0 ; $i <= $this->backTraceSkip ; $i++) + $back = array_shift ($backtrace); $msg = ""; if (isset ($_SERVER["REMOTE_ADDR"])) {