logging - How to disable laravel logs temporarily? -


i felt log recursion problem , disable logs single operation. there kind of runtime switch laravel logs? like:

<?php log::stop(); // bypass log here log::resume(); 

unfortunately, there no way through facade on example above. what's best way turn laravel log off temporarily?

here hacky way it. swap facade instance mock.

with mockery:

$app = log::getfacaderoot(); log::shouldreceive('error', 'warning', 'debug', 'info', 'notice', 'critical', 'alert', 'emergency');  // bypass log here  log::swap($app); 

without mockery:

class logmock {     public function __call($name, $arguments) {} }  $app = log::getfacaderoot(); log::swap(new logmock);  // bypass log here  log::swap($app); 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -