Giter Site home page Giter Site logo

Improve logging about groupbutler HOT 5 CLOSED

group-butler avatar group-butler commented on July 24, 2024
Improve logging

from groupbutler.

Comments (5)

NotAFile avatar NotAFile commented on July 24, 2024

I personally value at least having an option of human-readable logs a lot.

from groupbutler.

yangm97 avatar yangm97 commented on July 24, 2024

So what about this:

Make a customisable log function/module with levels mimicking ngx.log ones. In config you could set where and how you want the logs delivered: stdout (either json or human), telegram, prometheus, etc.

from groupbutler.

NotAFile avatar NotAFile commented on July 24, 2024

Yeah, most coventional logging libraries allow you to plug long handlers that do different things with the logs, e.g. print them, email them, transmit them.

What twisted does, which I really really like is the following:

log.error("new group {groupname}, {membercount}", name="whatever", membercount=34)

That way, you can have both human and machine readable logs at the same time. You can set up different handlers for these messages then.

More generally, I think it's a mistake to take things that make sense on a large e.g. facebook or netflix scale and try to emulate it "just because". JSON logs, ELK stack etc. probably doesn't make sense for most GB deployments, the official one even, where there is a single server, single process, and a "grep" command can search it in less than a millisecond.

from groupbutler.

yangm97 avatar yangm97 commented on July 24, 2024

I think dendrite has some kind of middle ground logging too, somewhat like this:

time="2018-06-23T16:15:41.788287481Z" level=warning msg="Didn't call Close on UserStreamListener" req.id=kQrtSRo4EDSm req.method=GET req.path=/_matrix/client/r0/sync

(Of course we don’t need millisecond precision but you get the idea)

But yeah, different log handlers. Telegram log handler could wrap some nice markdown around while stdout handler could look like that.

from groupbutler.

yangm97 avatar yangm97 commented on July 24, 2024

Since the issue was too broad and "logging" has "improved", I'm going to close this.

from groupbutler.

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.