Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
15d112aa
Commit
15d112aa
authored
Aug 24, 2021
by
Dominik Hebeler
Browse files
switched log key for redis to fix file permissions
parent
4fe1a33e
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Console/Commands/AppendLogs.php
View file @
15d112aa
...
...
@@ -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!"
);
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment