From 0b4a4cb367efb1cb60482facb7035aaa1dcf4c59 Mon Sep 17 00:00:00 2001 From: RomeroMsk Date: Fri, 2 Oct 2015 16:21:09 +0300 Subject: [PATCH] changed VarDumper::export() to VarDumper::dumpAsString() --- GraylogTarget.php | 8 ++++---- README.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GraylogTarget.php b/GraylogTarget.php index 2c1ca23..6b35cbe 100644 --- a/GraylogTarget.php +++ b/GraylogTarget.php @@ -88,21 +88,21 @@ public function export() if ($short !== null) { $gelfMsg->setShortMessage($short); // All remaining message is fullMessage by default - $gelfMsg->setFullMessage(VarDumper::export($text)); + $gelfMsg->setFullMessage(VarDumper::dumpAsString($text)); } else { // Will use log message as shortMessage by default (no need to add fullMessage in this case) - $gelfMsg->setShortMessage(VarDumper::export($text)); + $gelfMsg->setShortMessage(VarDumper::dumpAsString($text)); } // If 'full' is set will use it as fullMessage (note that all other stuff in log message will not be logged, except 'short' and 'add') if ($full !== null) { - $gelfMsg->setFullMessage(VarDumper::export($full)); + $gelfMsg->setFullMessage(VarDumper::dumpAsString($full)); } // Process additionals array (only with string keys) if (is_array($add)) { foreach ($add as $key => $val) { if (is_string($key)) { if (!is_string($val)) { - $val = VarDumper::export($val); + $val = VarDumper::dumpAsString($val); } $gelfMsg->setAdditional($key, $val); } diff --git a/README.md b/README.md index f9a031a..60b8184 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ return [ GraylogTarget will use traces array (first element) from log message to set `file` and `line` gelf fields. So if you want to see these fields in Graylog2, you need to set `traceLevel` attribute of `log` component to 1 or more. Also all lines from traces will be sent as `trace` additional gelf field. -You can log not only strings, but also any other types (non-strings will be exported by `VarDumper::export()`). +You can log not only strings, but also any other types (non-strings will be dumped by `yii\helpers\VarDumper::dumpAsString()`). By default GraylogTarget will put the entire log message as `short_message` gelf field. But you can set `short_message`, `full_message` and `additionals` by using `'short'`, `'full'` and `'add'` keys respectively: ```php