Comments (11)
@ronag this is where it is handled: https://github.com/pinojs/pino-http/blob/master/logger.js#L49-L53.
What do you propose? Would you like to send a PR?
from pino-http.
I don't think there is a way in NodeJS to differentiate between client and server aborted
. When the client aborts, printing an error with 418 is confusing.
from pino-http.
I don't think there is a way in NodeJS to differentiate between client and server aborted. When the client aborts, printing an error with 418 is confusing.
What do you mean?
from pino-http.
@mcollina: There are two scenarios where an "aborted" event is emitted.
- Server aborts due to
server.timeout
orreq.socket.setTimeout
. The current behaviour is correct for this case. - The client chooses to abort the request. The current behaviour is confusing for this case. It's not a timeout (
408
) and it's not an error forGET
andHEAD
requests.
from pino-http.
Perhaps we can listen for a close
event for detecting client abort...
Perhaps also veryifing by listening for a timeout
on the server object for server side timeouts
from pino-http.
although we're going to want to handle this in the most performant way of course..
@ronag can you point to a spec doc detailing a 408 not being an error for GET
and HEAD
?
from pino-http.
@davidmarkclements: A client aborting GET or HEAD is not a server error since they should be side effect free. (9.1.1 Safe Methods). Server aborting due to timeout should still be 408.
from pino-http.
- regardless of the method, a client aborting is not a timeout.
- a client aborting a safe method is not a server error.
from pino-http.
@ronag I still do not know yet how to fix this, and what do you propose. Also, #21 was closed.
Would you like to submit a PR with unit tests? You investigated this issue with much more details than us.
from pino-http.
@mcollina I don't know yet. nodejs/node#11014
from pino-http.
from pino-http.
Related Issues (20)
- use as middleware example HOT 2
- Documentation: res.log() is only mentioned in quietReqLogger? HOT 8
- [Documentation error]: The value assignment is set before the declaration
- reading 'stringifySym' doesn't work with next.js HOT 5
- IncomingMessage and ServerMessage typings are too specific HOT 2
- Updating for v10 HOT 2
- How can I put context in request completed log (when autoLogging is true) ?
- Release next version HOT 1
- node:util module not found HOT 6
- nestedKey now working properly HOT 1
- Message "request completed" when request not completed HOT 1
- `wrapChild` doesn't pass on options to the created child logger as expected HOT 3
- How best to handle extending req.log? HOT 6
- customProps causes TypeError: logger[stringifySym] is not a function HOT 17
- Type 'Opts' does not satisfy the constraint 'string'.ts(2344) HOT 5
- TypeScript error when using customLevels on pino parent instance HOT 1
- Updating for v9 HOT 3
- Log req only on 1st log from the request HOT 2
- Unable to remove whole req object from response logs HOT 3
- Undocumented Breaking Changes for 9.0.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pino-http.