1
Fork 0
mirror of https://github.com/diced/zipline.git synced 2025-04-11 23:31:17 -05:00

chore: hook request instead of reply for debug request logger

This commit is contained in:
Jay 2025-02-16 15:09:06 -08:00
parent 80c9a66705
commit 5016b154ca
No known key found for this signature in database
GPG key ID: 97C2E533F17AF0EB

View file

@ -80,12 +80,12 @@ async function start() {
done();
});
server.addHook('onResponse', (req, reply, done) => {
server.addHook('onRequest', (req, reply, done) => {
if (config.core.logger) {
if (req.url.startsWith('/_next')) return done();
server.logger.child('response').info(`${req.method} ${req.url} -> ${reply.statusCode}`);
server.logger.child('response').debug(
server.logger.child('request').info(`${req.method} ${req.url} -> ${reply.statusCode}`);
server.logger.child('request').debug(
JSON.stringify({
method: req.method,
url: req.url,