Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-micro
Commits
a5ee47bf
Commit
a5ee47bf
authored
Apr 19, 2022
by
Liu lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志优化
parent
bcbf4b57
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
LogTraceAspect.php
src/Aspect/LogTraceAspect.php
+1
-1
LogTraceHandler.php
src/Handler/LogTrace/LogTraceHandler.php
+3
-6
No files found.
src/Aspect/LogTraceAspect.php
View file @
a5ee47bf
...
@@ -45,7 +45,7 @@ class LogTraceAspect extends AbstractAspect
...
@@ -45,7 +45,7 @@ class LogTraceAspect extends AbstractAspect
$requestId
=
LogTraceHandler
::
getRequestId
();
$requestId
=
LogTraceHandler
::
getRequestId
();
register_shutdown_function
(
function
()
use
(
$requestId
,
$originParams
,
$proceedingJoinPoint
)
{
register_shutdown_function
(
function
()
use
(
$requestId
,
$originParams
,
$proceedingJoinPoint
)
{
put_log
(
array_merg
e
([
put_log
(
json_encod
e
([
'request_id'
=>
$requestId
,
'error_msg'
=>
error_get_last
()
'request_id'
=>
$requestId
,
'error_msg'
=>
error_get_last
()
],
$originParams
),
],
$originParams
),
str_replace
(
'\\'
,
'_'
,
$proceedingJoinPoint
->
className
)
.
str_replace
(
'\\'
,
'_'
,
$proceedingJoinPoint
->
className
)
.
...
...
src/Handler/LogTrace/LogTraceHandler.php
View file @
a5ee47bf
...
@@ -103,13 +103,10 @@ class LogTraceHandler
...
@@ -103,13 +103,10 @@ class LogTraceHandler
$track
->
getFile
()
.
" line:"
.
$track
->
getFile
()
.
" line:"
.
$track
->
getLine
()
.
"
\n
"
.
$track
->
getLine
()
.
"
\n
"
.
$track
->
getTraceAsString
();
$track
->
getTraceAsString
();
}
}
else
if
(
is_string
(
$track
)
||
is_numeric
(
$track
))
{
if
(
is_array
(
$track
))
{
$logInfo
=
var_export
(
$track
,
true
);
}
if
(
is_string
(
$track
)
||
is_numeric
(
$track
))
{
$logInfo
=
$track
;
$logInfo
=
$track
;
}
else
{
$logInfo
=
print_r
(
$track
,
true
);
}
}
$logInfo
.=
"
\n\n
"
;
$logInfo
.=
"
\n\n
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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