tags:

views:

28

answers:

1

Does anybody know an all-purpose logging suite for PHP applications?

By "suite" I mean a lightweight library of logging functions as well as a mature back-end to view them.

The back-end would have to be configurable and show log entries using functions like

  • Filter by date

  • Filter by event (Warning, error, custom event)

  • Filter by category

  • Filter by user

  • Filter by associated database record (optional, I could add that myself)

I would like to use such an engine as a "log book" for database records inside my app - e.g. as a diary for a vehicle record, detailing events like "phone call", "buyer interest", "accident", "repair", "theft/damage"....)

The possibility to export log events through the PHP library (to show an event log within the app) is mandatory. RSS / XML export would also be nice.

I'm doing this myself at the moment inside the application. I've never seen anything like this so I realize it's a long shot, but I'm curious to seewhether there is any third party solution to this very common task.

+1  A: 

See if Apache's log4php suits your needs:

Log4php is logging framework for PHP at the Apache Software Foundation (ASF), sponsored by the Apache Logging Services project.

Log4PHP has completed graduation in March 2010.

log4php supports:

  • Configuration through xml and properties file (same structure as log4j).
  • File, RollingFile, DailyFile, Echo, Console, Mail, PDO, PHP error, Syslog or NT events and Socket appenders.
  • Simple, TTCC, Pattern, Html and Xml Layouts.
  • Nested (NDC) and Mapped (MDC) Diagnostic Contexts.
Gordon
Looks interesting, I will take a look.
Pekka