Skip to content

Commit

Permalink
Merge pull request #18 from kermorgant/kermorgant-patch-1
Browse files Browse the repository at this point in the history
id column handling (avoid removal)
  • Loading branch information
waza-ari committed Feb 13, 2017
2 parents d369248 + f33e003 commit fb9e674
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/MySQLHandler/MySQLHandler.php
Expand Up @@ -40,7 +40,7 @@ class MySQLHandler extends AbstractProcessingHandler
/**
* @var array default fields that are stored in db
*/
private $defaultfields = array('channel', 'level', 'message', 'time');
private $defaultfields = array('id', 'channel', 'level', 'message', 'time');

/**
* @var string[] additional fields to be stored in the database
Expand Down Expand Up @@ -136,7 +136,10 @@ private function prepareStatement()
$columns = "";
$fields = "";
foreach ($this->fields as $key => $f) {
if ($key == 0) {
if ($f == 'id') {
continue;
}
if ($key == 1) {
$columns .= "$f";
$fields .= ":$f";
continue;
Expand Down

0 comments on commit fb9e674

Please sign in to comment.