Code Monkey home page Code Monkey logo

Comments (3)

linde12 avatar linde12 commented on June 16, 2024 2

@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.

mcollina avatar mcollina commented on June 16, 2024

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.

ex-tag avatar ex-tag commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.