PHP Log2Files Advanced Logger (Miscellaneous)

This logger is an advanced library, which dumps PHP Application logs to file in production environment.

The main purpose is to ensure the logger is very fast and so can be used in production environment.
Multiple PHP execution threads log to consecutive files at the same time, to avoid synchronization and locking problems.

There is no need to do any additional setup. Just pure PHP (no mysql even!) and some simple API calls.

Features – the simplicity:

  • simple API – only two function calls needed to start logging: “open log with some configuration” and then “write to log”
  • no additional dependencies (no PEAR , no frameworks), just one PHP file with one class to include in your script
  • can be used with almost anything else, easily includable into any other library, framework or existing application

Features – two modes:

  • simple mode: the textual form – doesn’t need any special parsing
  • advanced mode: the BJSON form – stores all data with binary format which is very simple to parse and traverse. This can be used by advanced stats and monitoring tools

Features – performance:

  • minimal impact to the script timing,
  • no SQL , no databases, just PHP and filesystem,
  • aware of multi-threading, multiple calls from same web-client at the time, multiple scripts running at a time with very various duration (one in 10ms, while the other in 10secs),
  • very little thread/process switching and synchronization, allow OS caches (no flushes etc.),
  • so timing-cheap, that log-levels definition is not really needed (simply log all what may be needed),
  • dedicated for production environment (megabytes of log in an hour, tens of scripts executing at a time),

Features – other:

  • dedicated API for handling arrays and maps,
  • pre-made implementation for storage of: sessions, cookies, get&post, time of whole script execution,
  • easy to transport storage form (copy, delete, etc.): no thousands of files,

Documentation:
API documentation and some examples always accessible at http://yosh.ke.mu/article/k_log_overview.

Download PHP Log2Files Advanced Logger (Miscellaneous)

Leave a Reply

Your email address will not be published. Required fields are marked *