Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
message-call-service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邵兴业
message-call-service
Commits
9f8f3628
Commit
9f8f3628
authored
Aug 04, 2021
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 日志
parent
030e2adb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletions
+4
-1
README.md
+3
-0
public/images/iShot2021-08-04-16.18.40.png
+0
-0
utils/logger.js
+1
-1
No files found.
README.md
View file @
9f8f3628
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@


#### 全链路日志

#### API
#### API
> 注: 全链路追踪 请求头 X-Request-Id
> 注: 全链路追踪 请求头 X-Request-Id
...
...
public/images/iShot2021-08-04-16.18.40.png
0 → 100644
View file @
9f8f3628
533 KB
utils/logger.js
View file @
9f8f3628
...
@@ -6,7 +6,7 @@ import moment from 'moment';
...
@@ -6,7 +6,7 @@ import moment from 'moment';
import
path
from
"path"
import
path
from
"path"
const
myFormat
=
format
.
printf
(({
level
,
message
,
timestamp
,
requestId
})
=>
{
const
myFormat
=
format
.
printf
(({
level
,
message
,
timestamp
,
requestId
})
=>
{
return
`[
${
moment
(
timestamp
).
format
(
"YYYY-MM-DD
hh
:mm:ss.SSS"
)}
] [
${
level
}
]
${
requestId
?
(
"["
+
requestId
+
"] :"
)
:
''
}
${
message
}
`
;
return
`[
${
moment
(
timestamp
).
format
(
"YYYY-MM-DD
HH
:mm:ss.SSS"
)}
] [
${
level
}
]
${
requestId
?
(
"["
+
requestId
+
"] :"
)
:
''
}
${
message
}
`
;
});
});
const
requestId
=
format
((
info
)
=>
{
const
requestId
=
format
((
info
)
=>
{
...
...
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