diff --git a/src/Log.php b/src/Log.php index 9c9d061..a877459 100644 --- a/src/Log.php +++ b/src/Log.php @@ -198,10 +198,10 @@ class Log { $msg[] = $message; $msg = implode(' - ', $msg)."\n"; } - if (self :: $file_fd) + if (!self :: $file_fd || php_sapi_name() == 'cli-server') + error_log(rtrim($msg, "\n")); + else fwrite(self :: $file_fd, $msg); - elseif (self :: $error_log_fallback) - error_log($msg); if ($level == 'FATAL') if (!is_null(self :: $fatal_error_handler))