diff --git a/src/Monolog/Handler/SlackHandler.php b/src/Monolog/Handler/SlackHandler.php index 59d4836f..c5428759 100644 --- a/src/Monolog/Handler/SlackHandler.php +++ b/src/Monolog/Handler/SlackHandler.php @@ -96,7 +96,8 @@ class SlackHandler extends SocketHandler $this->useAttachment = $useAttachment; $this->useShortAttachment = $useShortAttachment; $this->includeContextAndExtra = $includeContextAndExtra; - if ($this->includeContextAndExtra) { + + if ($this->includeContextAndExtra && $this->useShortAttachment) { $this->lineFormatter = new LineFormatter; } }