Coder Social home page Coder Social logo

Redis logging about servertech-chat HOT 3 OPEN

anarthal avatar anarthal commented on May 28, 2024
Redis logging

from servertech-chat.

Comments (3)

mzimbres avatar mzimbres commented on May 28, 2024

The develop branch has logging disabled by default. I also don't know how health checks are supposed to work with XADD since the client can't send pings while it is blocked on XADD etc. You might have to add a second connection to redis that will only does health-checks and cancel other connections in case of a timeout, but this will add some non-trivial complexity. Another option is to use a time interval to XADD that is half of the health checks timeout, so when XADD returns the pings have a chance of being sent before a new XADD is performed.

from servertech-chat.

anarthal avatar anarthal commented on May 28, 2024

As far as I know XADD never blocks - it's XREAD, which we don't use (just because it blocks). So this is just a matter of upgrading Boost.Redis and re-enabling health checks.

I'd still want logged when a redis::connection connects successfully or disconnects from the server, for diagnostics. Is it possible to have these without all the "X bytes written" logs?

from servertech-chat.

mzimbres avatar mzimbres commented on May 28, 2024

As far as I know XADD never blocks

Yes, I refered to the wrong command.

  • it's XREAD, which we don't use (just because it blocks). So this
    is just a matter of upgrading Boost.Redis and re-enabling health
    checks.

Humm, ok. I thought we would have a connection watching for new elements being added to the Redis stream. If we don't do that, than yes, just re-enable the health checks.

I'd still want logged when a redis::connection connects successfully
or disconnects from the server, for diagnostics. Is it possible to
have these without all the "X bytes written" logs?

Yes, definitely. Boost.Redis default logger has syslog like levels, so we can put connected, resolve etc. messages at a higher level that x-bytes-written. Feel free to open an issue.

I must say that without fmt the logger interface is still messy. It is something I added mostly for myself because as the number of built-in functionality grew e.g. reconnection, health-checks, automatic connect, resolve etc. it became impossible to understand users and my own problems.

Notice that my logger is not thread safe because it uses std::clog to log.

from servertech-chat.

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.