Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Kai
    @kaishh
    You can still make it JSON sink afaik
    Dermot Haughey
    @hderms
    my goal is to wrap the slf4j log in a json object i don't really care if it's not perfectly converted to json in a structured manner
    Paul S.
    @pshirshov
    Probably @kaishh is right.
    slf4j bridge requires initialization
    Do you have such a call somewhere in your code?
    Dermot Haughey
    @hderms
    i do not
    Kai
    @kaishh
    Paul S.
    @pshirshov
    Okay, that's the answer
    You may use our test as an example
    Dermot Haughey
    @hderms
    router is protected
    there we go thanks
    i believe the test provides the answer
    Paul S.
    @pshirshov

    router is protected

    But you instantiate router somewhere anyway, right? Just pass it to the bridge

    Dermot Haughey
    @hderms
    i did not instantiate router anywhere
    Kai
    @kaishh
    IzLogger.apply() creates router on its own, so it doesn’t have to be manually created
    Dermot Haughey
    @hderms
    wonderful
    well I officially love logstage
    Paul S.
    @pshirshov
    You are welcome
    Kai
    @kaishh
    I guess .router should be unprotected, since this makes smart constructors less desirable :\
    Cheers!
    Paul S.
    @pshirshov
    @hderms : there is still some work which needs to be done - we need to improve layout definition language and reimplement configuration logic. So in case you are unhappy with some things - we will fix em eventually.
    Dermot Haughey
    @hderms
    yeah i like the overall design though
    we are dependency injecting the logger down the call tree adding context with logger('foo' -> 'bar')
    Dermot Haughey
    @hderms
    the design is really good for structured logging
    tried to use scribe and others and they just aren't designed to do structured logging
    MDC's are a terrible pattern imo
    Paul S.
    @pshirshov
    Exactly
    In case you like logstage you may look at our other things
    :)
    Actually, we have a DI framework
    And an RPC framework too. But it's in an early beta
    Dermot Haughey
    @hderms
    distage seemed cool but we don't have enough dependencies to need/want a framework at the moment
    might reconsider eventually
    Dermot Haughey
    @hderms
    I think one thing I could actually reccomend for logstage is just an easy way to log a case class that has a circe encoder like
    @JsonCodec Foo(bar: Int)
    logger.info(Foo(42))
    the logic behind this is i think sometimes it makes sense to build a data object to represent the results of some process and being able to log that directly seems advantageous
    it seems, in my opinion, to be a use case that fits with the philosophy of structured logging
    Maksym
    @ratoshniuk
    This message was deleted
    Paul S.
    @pshirshov
    @hderms : ok, I'll think about it. Should be relatively easy to implement. You may try to patch LogUnit.argToString for the time being
    Kai
    @kaishh
    I guess it would be easier to create a shapeless typeclass to turn records into Seq[LogArg] and add it to Entry before logging than to patch the macro.
    Paul S.
    @pshirshov
    Also you may just invoke .asJson on your arguments and patch LogstageCirceRenderingPolicy to support raw json values
    Dermot Haughey
    @hderms
    @pshirshov that could work
    maybe it would make sense to meet in the middle and just make logstage support logging json directly
    Paul S.
    @pshirshov
    I will do it
    But in case you need it right now - you may make a quick patch
    Dermot Haughey
    @hderms
    thanks very much