diff --git a/src/nsqphp/Logger/Stderr.php b/src/nsqphp/Logger/Stderr.php index d8bd0ba..48bc91f 100644 --- a/src/nsqphp/Logger/Stderr.php +++ b/src/nsqphp/Logger/Stderr.php @@ -53,6 +53,10 @@ public function debug($msg) private function log($level, $msg) { $msg = $msg instanceof \Exception ? $msg->getMessage() : (string)$msg; - fwrite(STDERR, sprintf('[%s] %s: %s%s', date('Y-m-d H:i:s'), strtoupper($level), $msg, PHP_EOL)); + if ($level == 'error') { + fwrite(STDERR, sprintf('[%s] %s: %s%s', date('Y-m-d H:i:s'), strtoupper($level), $msg, PHP_EOL)); + } else { + fwrite(STDOUT, sprintf('[%s] %s: %s%s', date('Y-m-d H:i:s'), strtoupper($level), $msg, PHP_EOL)); + } } -} \ No newline at end of file +}