Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    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
    i guess one of the weird cases would be how that would work with a ConsoleSink but you guys would know better than i
    Kai
    @kaishh
    We could flatten json structures for console display 🤔 I guess that would be more greppable than rendering them nested
    Paul S.
    @pshirshov
    @/all announcement for logstage users: I'm json layout will be different since next release. An example of the new one:
    {
      "event" : {
        "random_value" : -1835613809,
        "just_a_list" : [
          10,
          "green",
          "bottles"
        ],
        "just_an_arg" : "this is an argument"
      },
      "context" : {
        "ctx" : "bottles"
      },
      "meta" : {
        "class" : "a5cb76fb",
        "logger" : "com.github.pshirshov.izumi.logstage.sink.ExampleService.start",
        "line" : 20,
        "file" : "ExampleService.scala",
        "level" : "debug",
        "timestamp" : 1556211086466,
        "datetime" : "2019-04-25T16:51:26.466Z[UTC]",
        "thread" : {
          "id" : 1,
          "name" : "ScalaTest-run-running-LogstageCirceRenderingTest"
        }
      },
      "text" : {
        "template" : "Service started. argument: ${just_an_arg}, another arg: ${just_a_list}, Random value: ${random_value}",
        "message" : "Service started. argument: justAnArg=this is an argument, another arg: justAList=List(10, green, bottles), Random value: random value=-1835613809"
      }
    }
    Kai
    @kaishh

    Released Izumi 0.8.8

    Key changes:

    • Logstage is now available for Scala.js thanks to @pshirshov ! (#593)

    Fixed bugs:

    • Move scalacOptions out of globalSettings since they can end up in the meta build (#601)
    • logstage 0.8.7 does not support java 8 (#595)

    Dependency updates:

    • Update zio to 1.0.0-RC11-1 (#606)
    • Update http4s-blaze-client, ... to 0.21.0-M3 (#604)
    • Update cats-effect to 2.0.0-M5 (#602)
    Paul S.
    @pshirshov
    /all : com.github.pshirshov prefix has been removed in 0.9.0. Also we've fixed scala-reflect concurrency issues and introduced our own lightweight alternative: https://blog.7mind.io/lightweight-reflection.html
    Dermot Haughey
    @hderms
    is there a way to control what key in the JSON context gets mapped to
    or event
    i want to put my custom data in a specific field
    Kai
    @kaishh
    @hderms You can override LogstageCirceRenderingPolicy with different behavior and pass your instance to your LogSink
    Dermot Haughey
    @hderms
    sweet
    that's nice