Commit 01361885 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch 'development' into 1184-update-laravel-to-9-x

parents bdac4802 fecfcaf8
......@@ -31,6 +31,9 @@ spec:
- name: secrets
secret:
secretName: {{ template "secret_name" . }}
- name: mglogs-persistent-storage
persistentVolumeClaim:
claimName: mg-logs
- name: redis-config
configMap:
name: {{ include "chart.fullname" . }}-redis-container-config
......@@ -74,6 +77,9 @@ spec:
- name: secrets
mountPath: /metager/metager_app/database/seeds/UsersSeeder.php
subPath: USERSEEDER
- name: mglogs-persistent-storage
mountPath: /metager/metager_app/storage/logs/metager
readOnly: false
ports:
- name: http
containerPort: 8080
......@@ -111,6 +117,9 @@ spec:
mountPath: /metager/metager_app/.env
subPath: ENV_PRODUCTION
readOnly: true
- name: mglogs-persistent-storage
mountPath: /metager/metager_app/storage/logs/metager
readOnly: false
ports:
- name: http
containerPort: 8080
......
......@@ -54,17 +54,19 @@ class AppendLogs extends Command
}
$elements = [];
$elementCount = $redis->llen(\App\Console\Commands\AppendLogs::LOGKEY);
$elements = $redis->lpop(\App\Console\Commands\AppendLogs::LOGKEY, $elementCount);
if (!is_array($elements) || sizeof($elements) <= 0) {
return;
while(($value = $redis->lpop(\App\Console\Commands\AppendLogs::LOGKEY)) !== false){
$elements[] = $value;
}
if (file_put_contents(\App\MetaGer::getMGLogFile(), implode(PHP_EOL, $elements) . PHP_EOL, FILE_APPEND) === false) {
$this->error("Konnte Log Zeile(n) nicht schreiben");
$redis->lpush(\App\Console\Commands\AppendLogs::LOGKEY, array_reverse($elements));
} else {
$this->info("Added " . sizeof($elements) . " lines to todays log!");
$this->error("Konnte " . sizeof($elements) . " Log Zeile(n) nicht schreiben");
foreach($elements as $element){
$redis->lPush(\App\Console\Commands\AppendLogs::LOGKEY, $element);
}
}else{
$this->info("Added " . sizeof($elements) . " lines to todays log! " . \App\MetaGer::getMGLogFile());
}
}
}
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