3

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
  • Not a real answer, but the most simple thing that could possibly work is using syslog. There are a couple of tools, GUI and web for viewing the stuff. However, syslog is a linear textual log format, so no cool features and extensions had to be shoehorned into its text line format (csv/json?). debianhelp.co.uk/syslogweb.htm Commented Aug 2, 2010 at 15:26

1 Answer 1

2

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.
Sign up to request clarification or add additional context in comments.

1 Comment

Looks interesting, I will take a look.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.