tekrat

xLog

xlog_info_logo

xLog provides extended logging and fatal logging facilities to PHP.

Instead of the typical fatal errors in PHP:

PHP Fatal error: Call to undefined function foo() in /www/test.php on line 3

xLog will now output an additional error with extended information and full backtraces:

[15415:0000001:0001] [xlog1.0.0] Fatal PHP Fatal error: Call to undefined function foo() in /www/foo.php on line 3
(ip: 127.0.0.1)
(at: localhost/foo.php)
(referer: <empty>)
(agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.5) Gecko/2008120121 Firefox/3.0.5)
(post: <empty>)
(cookies: <empty>)
trace starts at [/www/foo.php:3]

#0 in bar at [/www/foo.php:3]
#1 bar(’somestring’, 10039877, <object>, TRUE), called at [/www/foo.php:5]

Screenshot (phpinfo):

xlog_phpinfo

Git Repository:

http://tekrat.com/code_repository/

Downloads:

v1.0.2: xlog-1.0.2.tar.bz2

v1.0.1: xlog-1.0.1.tar.bz2

v1.0.0: xlog-1.0.0.tar.bz2

v0.0.3: xlog-0.0.3.tar.bz2

v0.0.2: xlog-0.0.2.tar.bz2

v0.0.1: xlog-0.0.1.tar.bz2

5 Responses for "xLog"

  1. Arnaud January 19th, 2009 at 1:16 am

    xdebug does that too, what are the differences/advantages of xlog ?

  2. shire January 19th, 2009 at 2:16 am

    I actually wasn’t aware that xdebug was doing fatal error logging/backtraces, but it looks like this is actually supported. I originally wrote xlog with the specific purpose for use on production servers for Fatal error logging. I think both xdebug and xlog offer different configuration/use options ie: xdebug can dump specific variables from $_SERVER variables, and xlog’s configuration for what is displayed is a bit different. xlog also isn’t focused on displaying output via HTML as it’s intended for a production environment not development, it also displays it’s error logs as one line rather than multiple etc. There does seem to be a lot of overlap between the two, however. I’d be interested to know how many people are using xdebug for error logging in their production environments?

  3. Dennis January 20th, 2009 at 5:42 am

    Would this provide insight into zend_mm_heap corrupted errors aswell?

  4. shire January 20th, 2009 at 2:25 pm

    Nope this won’t help with any sort of zend_mm_heap corruption errors as it still requires some basic core functionality including the memory manager. In this case you have some fundamentally serious problems at a lower level that should be investigated with tools such as valgrind or with the debug version of PHP.

  5. James Byers April 14th, 2009 at 9:55 am

    We’ve been looking for something like xlog for a little while, thanks. xdebug does overlap, but I’ve not felt great about putting it in production. It’s going to be a lot easier to audit and test xlog for this one feature we need in production than to disable all the other stuff in xdebug and do the same.


Leave a reply