Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Paul S.
    @pshirshov
    You are welcome
    Kai
    @neko-kai
    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
    @neko-kai
    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
    @neko-kai
    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
    @neko-kai

    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
    @neko-kai
    @hderms You can override LogstageCirceRenderingPolicy with different behavior and pass your instance to your LogSink
    Dermot Haughey
    @hderms
    sweet
    that's nice
    Kai
    @neko-kai
    @pshirshov ! @kapke wants to talk to you about testing
    pls respond
    Paul S.
    @pshirshov
    @kapke : what's up? )
    vonchav
    @voonchav_gitlab

    Hi, thanks for building this lib. I've been playing with it and trying to integrate it into my app. I was reading about config: https://izumi.7mind.io/latest/release/doc/logstage/config.html

    One thing I find very confusing is that this article does not mention the alternative. Most of it talks about how to use it in the context of distage. The only thing you mention about other approach is just one line: "There are two libs for logstage config. The second one depends on distage and config LogstageModule which binds logstage config."

    Therefore, my question to you is, if I use typesafe config (with or without pureconfig), do I just add the logStage config to my application config? What does the logstage-config lib do? Looking at the repo, logstage-config simply includes a 0-byte file, reference.conf. Doesn't seem to do anything else. Could you point me to the right direction or docs, or show me an example? Thanks. I apologize if this question has been asked before.

    Paul S.
    @pshirshov

    What does the logstage-config lib do? Looking at the repo, logstage-config simply includes a 0-byte file, reference.conf. Doesn't seem to do anything else.

    Yup, it's an outdated thing which will be removed

    We had some logic for declarative hocon configuration previously, but it was a 3rd party contribution which didn't survive a major refactoring - the author decided to not update it
    Though it's not flexible enough
    Any contributions welcome...