Skip to content

Commit

Permalink
Update wrapper.php
Browse files Browse the repository at this point in the history
use the watchdog log format, log at INFO level
  • Loading branch information
blacknell committed Jun 6, 2019
1 parent e54e1e8 commit 55671f6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions example/wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@
throw new \LogicException ('Could not open log file for writing');
}
fclose($f);
$logHandler = new StreamHandler($logfile, Logger::DEBUG);
$logHandler->setFormatter(new LineFormatter(null, Moment::ATOM));
$logHandler = new StreamHandler($logfile, Logger::INFO); // change to DEBUG for testing
$logHandler->setFormatter(new LineFormatter(null, Watchdog::LOG_DATE_FORMAT));
$log->pushHandler($logHandler);

}
catch (\LogicException $e) {
$logHandler = new NullHandler(Logger::DEBUG);
$logHandler = new NullHandler(Logger::INFO);
}
catch (\Exception $e) {
$logHandler = new NullHandler(Logger::DEBUG);
$logHandler = new NullHandler(Logger::INFO);
}

$wrapper = new Blacknell\Watchdog\Watchdog($log);

$wrapper->watch(
'/bin/ls', // replace this with the command that starts your long live process
'/bin/ls', // replace this with the command that starts your long lived process
"mygrepstring", // replace this with a script that will be grep'd to see if it is still running
'/tmp/mywatchdog.watchdog', // your script should touch this file regularly
15); // and this is how regularly (worst case)
15); // and this is how regularly (worst case) in seconds

0 comments on commit 55671f6

Please sign in to comment.