Skip to content

Commit

Permalink
Correctly log level and message into message
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Feb 4, 2017
1 parent 64d1610 commit 1ef8bd7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/AbstractLogglyLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ protected function format($level, $message, array $context): string
$message = $this->processPlaceHolders($message, $context);
$json = json_encode([
'level' => $level,
'message' => $message,
'level_message' => $level . ' ' . $message,
'message' => $level . ' ' . $message,
'context' => $context,
]);

Expand Down
2 changes: 1 addition & 1 deletion tests/LogglyBulkLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getLogger()
$request = $this->prophesize(Request::class);
$request->end(Argument::that(function ($data) {
$json = json_decode($data, true);
$this->logs[] = $json['level_message'];
$this->logs[] = $json['message'];
return true;
}))->shouldBeCalled();

Expand Down
2 changes: 1 addition & 1 deletion tests/LogglyLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function getLogger()
$request = $this->prophesize(Request::class);
$request->end(Argument::that(function ($data) {
$json = json_decode($data, true);
$this->logs[] = $json['level_message'];
$this->logs[] = $json['message'];
return true;
}))->shouldBeCalled();

Expand Down

0 comments on commit 1ef8bd7

Please sign in to comment.