Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Commits
6fd01103
Commit
6fd01103
authored
2 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
fixed command camelcase
parent
4dfee0b1
No related branches found
Branches containing commit
No related tags found
2 merge requests
!1973
Development
,
!1969
Resolve "Logging Search Queries not working"
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
metager/app/QueryLogger.php
+5
-5
5 additions, 5 deletions
metager/app/QueryLogger.php
with
5 additions
and
5 deletions
metager/app/QueryLogger.php
+
5
−
5
View file @
6fd01103
...
...
@@ -61,7 +61,7 @@ class QueryLogger
/** @var \Redis $redis */
$redis
=
Redis
::
connection
();
$redis
->
r
P
ush
(
self
::
REDIS_KEY
,
\json_encode
(
$log_entry
));
$redis
->
r
p
ush
(
self
::
REDIS_KEY
,
\json_encode
(
$log_entry
));
}
/**
...
...
@@ -70,10 +70,10 @@ class QueryLogger
*/
public
static
function
flushLogs
()
{
/** @var \
R
edis */
/** @var \
Pr
edis
\Client
*/
$redis
=
Redis
::
connection
();
$queue_size
=
$redis
->
l
L
en
(
self
::
REDIS_KEY
);
$queue_size
=
$redis
->
l
l
en
(
self
::
REDIS_KEY
);
/**
* Will hold the Strings that get written to logfile. One entry per line
...
...
@@ -87,7 +87,7 @@ class QueryLogger
*
* @var string[] $query_logs
*/
$query_logs
=
$redis
->
l
R
ange
(
self
::
REDIS_KEY
,
0
,
$queue_size
-
1
);
$query_logs
=
$redis
->
l
r
ange
(
self
::
REDIS_KEY
,
0
,
$queue_size
-
1
);
foreach
(
$query_logs
as
$query_log
)
{
$query_log
=
\json_decode
(
$query_log
);
$time
=
DateTime
::
createFromFormat
(
"Y-m-d H:i:s"
,
$query_log
->
time
,
new
DateTimeZone
(
"Europe/Berlin"
));
...
...
@@ -108,7 +108,7 @@ class QueryLogger
Log
::
info
(
"Added "
.
sizeof
(
$log_strings
)
.
" lines to todays log! "
.
$log_file
);
// Now we can pop those elements from the list
for
(
$i
=
0
;
$i
<
sizeof
(
$query_logs
);
$i
++
)
{
$redis
->
l
P
op
(
self
::
REDIS_KEY
);
$redis
->
l
p
op
(
self
::
REDIS_KEY
);
}
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment