Skip to content

Commit

Permalink
Bugfix: greyhole --logs should not watch both .log and .err, as .log …
Browse files Browse the repository at this point in the history
…will always contains all the same logs as .err
  • Loading branch information
gboudreau committed May 24, 2020
1 parent 16bfeb8 commit 0bf6fd6
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions includes/CLI/LogsCliRunner.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
Copyright 2009-2014 Guillaume Boudreau
Copyright 2009-2020 Guillaume Boudreau
This file is part of Greyhole.
Expand All @@ -23,7 +23,6 @@
class LogsCliRunner extends AbstractAnonymousCliRunner {
public function run() {
$greyhole_log_file = Config::get(CONFIG_GREYHOLE_LOG_FILE);
$greyhole_error_log_file = Config::get(CONFIG_GREYHOLE_ERROR_LOG_FILE);
if (strtolower($greyhole_log_file) == 'syslog') {
if (gh_is_file('/var/log/syslog')) {
passthru("tail -F -n 1 /var/log/syslog | grep --line-buffered Greyhole");
Expand All @@ -33,12 +32,6 @@ public function run() {
} else {
$files = escapeshellarg($greyhole_log_file);
passthru("tail -n 1 $files");
if (!empty($greyhole_error_log_file)) {
if (!file_exists($greyhole_error_log_file)) {
file_put_contents($greyhole_error_log_file, '');
}
$files = escapeshellarg($greyhole_error_log_file) . " " . $files;
}
passthru("tail -qF -n 0 $files");
}
}
Expand Down

0 comments on commit 0bf6fd6

Please sign in to comment.