Monday, January 12, 2009

logging in php + XSLT view

For starters, http://www.waltercedric.com/mambo-mainmenu-102/265-comlog4php/588-log4php-usage.html is a good place.
But I found some people just might need some more push. So here is what I did:
  1. Download log4php
  2. Copy log4php + tests folder into htdocs
  3. Add log4php.properties in same folder, with quote in the link
  4. Now just test if logger works with tests/test_body.php (just add 'define('LOG4PHP_DIR', '../log4php');' in test_body.php)

Hopefully this should work!

Once you are done with that, say u want to display data to some Admin who views from browser - You can use some XSLT XML magic here.

  1. Try to save the data in the format you can separate the information bits later in future. eg - 2009-01-13 05:14:39,512 : INFO : UserData: getUserInfo(1):phil8000../images/prelert.gif
  2. In the above case, I will separate the tags by colon points (:) and build an XML with records
  3. Build an XSLT to read the value of XML
  4. User can view the log as an HTML page now.

No comments:

Post a Comment