forked from mirror/MCSManager
Feat: optimze log info
This commit is contained in:
parent
af282d7154
commit
806a93d39e
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,6 +18,7 @@ dist/
|
|||||||
out/
|
out/
|
||||||
public/
|
public/
|
||||||
production/
|
production/
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
|
@ -75,8 +75,12 @@ app.use(
|
|||||||
|
|
||||||
// Http log and print
|
// Http log and print
|
||||||
app.use(async (ctx, next) => {
|
app.use(async (ctx, next) => {
|
||||||
logger.info(`[HTTP] ${ctx.ip} ${ctx.method} - ${ctx.URL.href}`);
|
const ignoreUrls = ["/api/overview", "/api/files/status"];
|
||||||
logger.info(`[HTTP] ${ctx.session.userName}`);
|
for (const iterator of ignoreUrls) {
|
||||||
|
if (ctx.URL.pathname.includes(iterator)) return await next();
|
||||||
|
}
|
||||||
|
logger.info(`[HTTP] ${ctx.method}: ${ctx.URL.href}`);
|
||||||
|
logger.info(`[HTTP] IP: ${ctx.ip} USER: ${ctx.session.userName} UUID: ${ctx.session.uuid}`);
|
||||||
await next();
|
await next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user