Skip to content

Commit

Permalink
Added general disclaimer to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
bradmkjr committed Feb 27, 2016
1 parent ea11050 commit 1dfabf9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ The class further allows to dynamically add extra attributes, which are stored i
Original based on:
Homepage: http://www.d-herrmann.de/projects/monolog-mysql-handler/

# Disclaimer
This is a very simple handler for monolog. It has a critical design flaw, which is it runs dbDelta on the log table everytime it is initialized. This allows the log to be very dynamic, but the trade off is a performance hit. dbDelta performs potentially dozens of SQL commands to compare the existing table structure to the proposed version. Depending on MySQL settings this may even slow down the site if tables are locked when trying to be written into. For my personal needs, I wanted to have a quick way to begin using Monolog, with plans to transistion to Mongo DB or cloud later, instead of using WordPress MySQL wrapper. This version works for custom plugin development, but I would not advise to distrubte this code in a public repository for general use on high traffic sites. You have been warned.

# Installation
monolog-wordpress is available via composer. Just add the following line to your required section in composer.json and do a `php composer.phar update`.

Expand All @@ -21,7 +24,6 @@ monolog-wordpress is available via composer. Just add the following line to your
Just use it as any other Monolog Handler, push it to the stack of your Monolog Logger instance. The Handler however needs some parameters:

- **$wpdb** Global instance of your DB connection.
- **$prefix** The table prefix where the logs should be stored
- **$table** The table name where the logs should be stored
- **$additionalFields** simple array of additional database fields, which should be stored in the database. The columns are created automatically, and the fields can later be used in the extra context section of a record. See examples below. _Defaults to an empty array()_
- **$level** can be any of the standard Monolog logging levels. Use Monologs statically defined contexts. _Defaults to Logger::DEBUG_
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": ["wordpress", "log", "logging", "monolog", "mysql", "database"],
"homepage": "https://github.com/bradmkjr/monolog-wordpress",
"license": "MIT",
"version": "1.0.2",
"version": "1.0.3",
"authors": [
{
"name": "Bradford Knowlton",
Expand Down

0 comments on commit 1dfabf9

Please sign in to comment.