Comments (3)
@mcollina Sounds good. I'll send a PR once i'm home where i remove the default error condition, but the main issue still remains. If you run example.js & GET 127.0.0.1:3000/error then both the actual error that was passed to next
and the default error are logged in two separate entries.
from express-pino-logger.
That's a different error. It's this line that gets logged whenever there is no error.
https://github.com/pinojs/pino-http/blob/80ec732c9d8c6693b61921a8147fae5715d23d07/logger.js#L46-L50
IMHO we might change it so no stacktrace is actually printed if there is no one, as that's there for no good reasons that I can find.
Would you like to send a PR to change that?
from express-pino-logger.
Probably better just to get rid of the stack trace. This really confused me. I was looking to get a stack trace on my application, and thought this was giving me one. Also had a lot of trouble figuring out how to actually get a trace to work, and tried request.log.trace()
but that did not work. Finally figured out that I could pass the Error
object, as request.log.error(Error(message))
...
from express-pino-logger.
Related Issues (20)
- why use this instead of pino-http? HOT 1
- express not responding
- What are the differences with pino-http? HOT 3
- Appending to every request. HOT 1
- ignore routes HOT 3
- QUESTION: pino and pino-express HOT 4
- How to find file and line that caused the error? HOT 6
- Unable to redact certain information from existing log files
- Update to Pino 6.x and pino-http 5.x
- Keys added to req/res not available to serializers HOT 5
- Exclude specific URLs from pino logs HOT 2
- Update new pino-http version HOT 2
- How to avoid the entire request being logged every time using pino? HOT 3
- how to filter by http status code HOT 2
- how to log cdn cloudflare ip address? HOT 2
- What is unit of measurement for the responseTime in logs HOT 1
- Clarify this is just a "clone" of pino-http HOT 2
- how to remove this "REQUEST COMPLETED" from pino HOT 1
- Incorrect readme.md example HOT 1
- Upgrade pino-http dependency to 6.0.0 HOT 3
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 express-pino-logger.