Skip to content

Commit

Permalink
add a check to do not log empty message
Browse files Browse the repository at this point in the history
  • Loading branch information
taylanunutmaz committed Sep 26, 2023
1 parent 8d2a018 commit 2836c05
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/DefaultLogWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ class DefaultLogWriter implements LogWriterInterface

public function saveLogs()
{
if(!empty(config('logging.channels.http-logger'))){
Log::channel('http-logger')->info($this->message);
}
else{
Log::info($this->message);
if (!empty($message)) {
if(!empty(config('logging.channels.http-logger'))){
Log::channel('http-logger')->info($this->message);
} else {
Log::info($this->message);
}
}
}

Expand Down

0 comments on commit 2836c05

Please sign in to comment.