Commit 15d112aa authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

switched log key for redis to fix file permissions

parent 4fe1a33e
......@@ -4,7 +4,6 @@ namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
use Log;
use Monospice\LaravelRedisSentinel\RedisSentinel;
class AppendLogs extends Command
......@@ -15,7 +14,7 @@ class AppendLogs extends Command
* @var string
*/
protected $signature = 'logs:gather';
const LOGKEY = "metager.logs";
const LOGKEY = "metager.logs.2021";
/**
* The console command description.
......@@ -54,7 +53,7 @@ class AppendLogs extends Command
$redis = RedisSentinel::connection('cache');
}
if ($redis === null) {
Log::error("No valid Redis Connection specified");
$this->error("No valid Redis Connection specified");
return;
}
......@@ -68,10 +67,10 @@ class AppendLogs extends Command
return;
}
if (file_put_contents(\App\MetaGer::getMGLogFile(), implode(PHP_EOL, $elements) . PHP_EOL, FILE_APPEND) === false) {
Log::error("Konnte Log Zeile(n) nicht schreiben");
$this->error("Konnte Log Zeile(n) nicht schreiben");
$redis->lpush(\App\Console\Commands\AppendLogs::LOGKEY, array_reverse($elements));
} else {
Log::info("Added " . sizeof($elements) . " lines to todays log!");
$this->info("Added " . sizeof($elements) . " lines to todays log!");
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment