Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 02 15:33
    david-bouyssie closed #120
  • Mar 02 15:33
    david-bouyssie commented #120
  • Mar 02 14:35
    darkfrog26 commented #120
  • Mar 02 08:28
    david-bouyssie commented #120
  • Feb 29 22:24

    darkfrog26 on 2.7.12

    (compare)

  • Feb 29 22:24

    darkfrog26 on master

    Release 2.7.12 (compare)

  • Feb 29 22:07

    darkfrog26 on master

    Update Scala.js to 1.0.0 - Cle… Fix travis deprecations Merge pull request #121 from lo… (compare)

  • Feb 29 22:07
    darkfrog26 closed #121
  • Feb 29 16:46
    lolgab synchronize #121
  • Feb 29 16:42
    lolgab edited #121
  • Feb 29 16:42
    lolgab edited #121
  • Feb 29 16:41
    lolgab edited #121
  • Feb 29 16:41
    lolgab opened #121
  • Feb 28 15:13
    darkfrog26 commented #120
  • Feb 28 14:39
    darkfrog26 commented #120
  • Feb 28 14:39
    darkfrog26 commented #120
  • Feb 28 08:16
    david-bouyssie commented #120
  • Feb 27 16:38
    david-bouyssie commented #120
  • Feb 27 14:04
    darkfrog26 commented #120
  • Feb 26 17:32
    david-bouyssie opened #120
Andreas Joseph Krogh
@andreak
That's what I want
Matt Hicks
@darkfrog26
okay
Instead of include I would do: .exclude(level < Level.Warn).exclude(level > Level.Warn)
that include will log WARN and anything below it (INFO, TRACE, DEBUG, etc.)
Andreas Joseph Krogh
@andreak
Yea, but that's filtered out by LogHandler.minimumLevel = Some(Level.Warn)
Matt Hicks
@darkfrog26
true, but you could just remove minimumLevel then and the logic would be more clear
Andreas Joseph Krogh
@andreak
But it will carry extra overhead so I should filter it out before it gets to the handler?
Right
Thanks.
Matt Hicks
@darkfrog26
performance probably won't make a difference
Andreas Joseph Krogh
@andreak
But clarity wins:-)
siyan
@blazingsiyan
@darkfrog26 hi~ I am not familiar with the java file APIs, is there any possibility that MaxLogFilesAction will leak file handles?
I have an App used scribe, when I turn on FileWriter’s maxLogs, and use lsof -p to list the open files of the running process, the number is increasing, and all of the newly opened files are pointing to the log dir
siyan
@blazingsiyan
scribe version: 2.7.6
Matt Hicks
@darkfrog26
@blazingsiyan I'll do some checking
@blazingsiyan I'm not seeing anything standing out. If you're willing to do some additional diagnostics I'd be happy to assist where I can.
Matt Hicks
@darkfrog26
the likely leak would be in orphaned LogFile entries
that aren't disposed
siyan
@blazingsiyan
    Files
      .newDirectoryStream(directory)
      .iterator()
      .asScala
      .toList
      .filter(MatchLogAndGZ)
      .filter(_.getFileName.toString.startsWith(prefix))
      .sortBy(Files.getLastModifiedTime(_))
will this code auto close? :sweat_smile:
@darkfrog26 just repeat eval the above code, the open file will keep increasing
Matt Hicks
@darkfrog26
@blazingsiyan is that being done somewhere in Scribe?
I should be closing everything that gets opened when dispose is called
Matt Hicks
@darkfrog26
@blazingsiyan aha! Can you log a ticket for that and I'll get a look this week?
siyan
@blazingsiyan
@darkfrog26 sure
Matt Hicks
@darkfrog26
Scribe 2.7.7 is released (@blazingsiyan this includes your PR)
siyan
@blazingsiyan
@darkfrog26 thanks :smiley:
Binh Nguyen
@ngbinh
@darkfrog26 I am interested in having async log for cats-effects and monix, do you have any pointer on how to achieve that with scribe? I have seen scribe.future but I am not sure if it is the best route
Anthony Cerruti
@srnb_gitlab
If you want cats safe logging I would suggest looking at https://github.com/ChristopherDavenport/log4cats @ngbinh
You could probably raise an issue for a scribe backend
Binh Nguyen
@ngbinh
@srnb_gitlab thanks, will look into it
Matt Hicks
@darkfrog26
@ngbinh also, this might be worth looking at: outr/scribe#105
Binh Nguyen
@ngbinh
do you know where to find log4cats-scribe?Looks like it get moved out of the main log4cats but doesn't seem like I can find the Github repo for it
Andreas Joseph Krogh
@andreak

Hi.
Is it possible to log a message with timing-info, like passing a Long => String function like this?

    def debug[T](msg: Long => String, blockOfCode: => T): T = {
        val t0 = System.currentTimeMillis()
        try {
            blockOfCode
        } finally {
            val t1 = System.currentTimeMillis()
            debug(msg(t1 - t0))
        }
    }

Could be used like val result = debug(ms => s"Time retrieving results: $ms ms.", myService.retrieveResults())

Eder Ruiz
@drrzmr
I have a project with logback + slf4j working fine, All libraries log respecting logback format. I want use scribe to log my application stuff, there are some way to make scribe respect logback format?
Eder Ruiz
@drrzmr
Or is better remove logback from project and format with scribe?
Andreas Joseph Krogh
@andreak
Well, we use the following to route "all" to slf4j, then to scribe:
log4j-over-slf4j
jcl-over-slf4j
jul-to-slf4j
And then we use scribe-slf4j to have scribe log everything. Works great!
Andreas Joseph Krogh
@andreak
So, including slf4j-api and logback-classic should be sufficient if I understand it correctly, according to https://www.slf4j.org/manual.html
Matt Hicks
@darkfrog26
@andreak sorry for the delay in response...life has been crazy. I've created a new company around messaging (https://courio.com), so all my time has been occupied by that.
@andreak, I'm not sure I understand your timing question. In MDC there is elapsed that allows convenience functionality to log elapsed times for blocks in your logs automatically.
@drrzmr Scribe is meant to be a better logging library. As such, it's not built on other logging libraries (like practically every other library out there). While it would be possible to write code that honors logback config, if you migrate to Scribe, you gain great flexibility to programmatically do things in logging that nothing else can do.
Andreas Joseph Krogh
@andreak
@darkfrog26 I wasn't aware of MDC's elapsed. I'll look into it, thanks for the pointer.
@drrzmr My suggestion is based on when you have to cope with legacy-code/libs using other logging-libraries but you want to use Scribe. I use this apporach with great success.
Arthur Mateos
@a-mateos
I'm interested in using Scribe in a project that uses Monix Tasks. Is there a way to use my set/override the Scribe MDC adapter with my own adapter?
Matt Hicks
@darkfrog26
@a-mateos, sorry for the late reply. The easiest solution would be to hook into MDC so that your own adapter applies to it.
Andreas Joseph Krogh
@andreak
@darkfrog26 Actually, removing minimumLevel = Some(Level.Warn) from the warnHandler in my example made a huge performance-hit when creating PDF-files using Apache-FOP, re-adding minimumLevel = Some(Level.Warn) and juse use .exclude(filterLevel > Level.Warn).excludeUnselected made it run 10x faster.
Matt Hicks
@darkfrog26
@andreak, that's really strange. Would you be interested in looking into the code on this and submitting a PR?
Andreas Joseph Krogh
@andreak
@darkfrog26 From what I understand, without minimumLevel = Some(Level.Warn) Apache-FOP (and probably other code) may produce lots of logging (at any level below WARNING) and then Scribe will filter it out later, but the logging will still be performed by the 3rd.-pary code, and maybe strange code-paths will be taken if (logger.isTraceEnabled) {doHeavyStuff()} who knows.
@darkfrog26 Note that the config I'm using is:
log4j-over-slf4j
jcl-over-slf4j
jul-to-slf4j
And then use scribe-slf4j to have scribe log everything