Giter Site home page Giter Site logo

Disable logging about rack-timeout HOT 4 OPEN

marek22k avatar marek22k commented on August 30, 2024
Disable logging

from rack-timeout.

Comments (4)

GalenkoEugene avatar GalenkoEugene commented on August 30, 2024

yes, try to find more details here
https://github.com/zombocom/rack-timeout/blob/main/doc/logging.md

PS: Rack::Timeout::Logger.disable

from rack-timeout.

marek22k avatar marek22k commented on August 30, 2024

Mhh, this works only conditionally. I can disable logging and assign my own logger. But what does not work is to assign my logger and change the logging level.

Rack::Timeout::Logger.level  = Logger::DEBUG
Rack::Timeout::Logger.logger = $Logger

still logs with level Info.

from rack-timeout.

GalenkoEugene avatar GalenkoEugene commented on August 30, 2024

try to filter by env[::Rack::Timeout::ENV_INFO_KEY].state inside Rack::Timeout.register_state_change_observer block

from rack-timeout.

panozzaj avatar panozzaj commented on August 30, 2024

I was looking for a way to make the logger only log when there was an exceptional case. I added:

Rack::Timeout::Logger.level = Logger::ERROR

in an initializer. Testing locally, this seems to cause only error-level (or higher) log messages to be printed.


@marek22k maybe you should flip the statements you listed, since the first one changes the log level of the rack-timeout default logger, and the second changes the logger to your custom $Logger (which uses whatever log level $Logger was already set to.)
[Could be wrong, and not a maintainer of this project. :) ]

from rack-timeout.

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.