Skip to content

Commit 0cd6e24

Browse files
committed
fix: reduce pwa serving logs noice
1 parent cb7992d commit 0cd6e24

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

serve-proxy.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,11 @@ const server = http.createServer((req, res) => {
329329
}
330330

331331
if (!config.silent) {
332-
const clientIp = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
333-
console.log(`[${new Date().toISOString()}] ${req.method} ${req.url}${config.logIp ? ` (${clientIp})` : ''}`);
332+
// Skip logging PWA asset requests to reduce noise. chrome somehoe sends this every second to dev server.
333+
if (!parsedUrl.pathname.includes('/assets/pwa/')) {
334+
const clientIp = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
335+
console.log(`[${new Date().toISOString()}] ${req.method} ${req.url}${config.logIp ? ` (${clientIp})` : ''}`);
336+
}
334337
}
335338

336339
// Handle directory requests without trailing slash

0 commit comments

Comments
 (0)