Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 20 17:03

    darkfrog26 on 3.5.3

    (compare)

  • Apr 20 17:03

    darkfrog26 on master

    Release 3.5.3 (compare)

  • Apr 20 05:40

    darkfrog26 on 3.5.2

    (compare)

  • Apr 20 05:40

    darkfrog26 on master

    Release 3.5.2 (compare)

  • Apr 20 04:45

    darkfrog26 on master

    Fixes (compare)

  • Apr 20 04:28

    darkfrog26 on master

    Added Scala 3.0.0-RC2 (compare)

  • Apr 20 04:18

    darkfrog26 on youi-client-0.14.0

    (compare)

  • Apr 20 04:18

    darkfrog26 on master

    Update youi-client to 0.14.0 Merge pull request #183 from ou… (compare)

  • Apr 20 04:18
    darkfrog26 closed #183
  • Apr 18 03:46

    darkfrog26 on testy-1.0.2

    (compare)

  • Apr 18 03:46

    darkfrog26 on master

    Update testy to 1.0.2 Merge pull request #182 from ou… (compare)

  • Apr 18 03:46
    darkfrog26 closed #182
  • Apr 18 03:46

    darkfrog26 on fabric-parse-1.0.3

    (compare)

  • Apr 18 03:46

    darkfrog26 on master

    Update fabric-parse to 1.0.3 Merge pull request #181 from ou… (compare)

  • Apr 18 03:46
    darkfrog26 closed #181
  • Apr 18 00:36
    darkfrog26 opened #183
  • Apr 18 00:36

    darkfrog26 on youi-client-0.14.0

    Update youi-client to 0.14.0 (compare)

  • Apr 18 00:36
    darkfrog26 opened #182
  • Apr 18 00:36

    darkfrog26 on testy-1.0.2

    Update testy to 1.0.2 (compare)

  • Apr 18 00:36
    darkfrog26 opened #181
Joesan
@joesan
assume that this application runs in a production environment with Log level to error, but to find out some issues, I would have to temporarily run it with a INFO level. How do I do that without touching the code? With the play logger, I just swap the log.xml config and restart the server instance (still a bad idea) but atleast I did not have to touch or deploy anything
Matt Hicks
@darkfrog26
is this a web application?
Joesan
@joesan
yes
Matt Hicks
@darkfrog26
first of all, I would get rid of the withMinimumLevel in your code above
Joesan
@joesan
ok why?
Matt Hicks
@darkfrog26
it's pointless...you are already defining a minimum in your LogHandler
also, doesn't Logger("com.bigelectrons").withModifier(boosted(Level.Debug, Level.Info)).replace() already do that?
by "that" I mean, make debug logs show?
Joesan
@joesan
that is just an experiement that I was trying
Matt Hicks
@darkfrog26
does it work?
Joesan
@joesan
I need to toggle between DEBUG, ERROR and INFO without touching the LoggingConfig
Matt Hicks
@darkfrog26
right, so there are several ways of doing this
the coolest way is in a running application
so, make an admin page in your web application that lets you set boosted logging
Joesan
@joesan
if I can get that, it would be awesome
with an API, I can do that, but that is not so awesome
Matt Hicks
@darkfrog26
then, you could essentially do something like:
def configureBoosting(shouldBoost: Boolean): Unit  = {
  if (shouldBoost) {
    Logger("com.bigelectrons").clearModifiers().withModifier(boosted(Level.Debug, Level.Info)).replace()
  } else {
    Logger("com.bigelectrons").replace()
  }
}
just invoke that method server-side from a request from the client
you could also do it via configuration file similarly
that's less exciting as it would require a restart of the application unless you have it monitoring the the file for changes
Joesan
@joesan
that's one possibility, but that is not something I want to do
Matt Hicks
@darkfrog26
starting to see how powerfully flexible Scribe is? :)
gotta run for now...good luck. :)
Maatary
@Maatary
@darkfrog26 thank you
Andreas Joseph Krogh
@andreak
Hi, I'm using Scribe-3.4.0 and to my surprise I'm seeing that my logs aren't rolling. I'm using the following config:
val moduleName = "stuffaroo"
val dailyRolling = rolling("-" % daily("-"))
val mdcFormatter: Formatter = formatter"$dateFull [$threadName] [${mdc(Constants.LOG_MDC_USERNAME_KEY)}] [${mdc(Constants.LOG_MDC_REQUEST_KEY)}] $levelColoredPaddedRight ${green(position)} - $message"
val consoleHandler = LogHandler(minimumLevel = Some(Level.Error), writer = ConsoleWriter, formatter = mdcFormatter)

val fileWriterTraceAll = FileWriter(
    Paths.get(System.getProperty("user.home"), "visena", "logs", moduleName) / ("trace" % dailyRolling % ".log")
).flushAsync

val fileWriterTrace = FileWriter(
    Paths.get(System.getProperty("user.home"), "visena", "logs", moduleName) / ("visena-trace" % dailyRolling % ".log")
).flushAsync

val fileWriterDebug = FileWriter(
    Paths.get(System.getProperty("user.home"), "visena", "logs", moduleName) / ("visena-debug" % dailyRolling % ".log")
).flushAsync

val fileWriterWarn = FileWriter(
    Paths.get(System.getProperty("user.home"), "visena", "logs", moduleName) / ("visena-warn" % dailyRolling % ".log")
).flushAsync

val fileWriterError = FileWriter(
    Paths.get(System.getProperty("user.home"), "visena", "logs", moduleName) / ("error" % dailyRolling % ".log")
).flushAsync

val selectedInternalPackages = select(
    packageName.startsWith("no.officenet"),
    packageName.startsWith("com.visena")
)

val traceAllHandler = LogHandler(
    writer = fileWriterTraceAll
    , formatter = mdcFormatter
)

val traceHandler = LogHandler(
    writer = fileWriterTrace
    , formatter = mdcFormatter
    , modifiers =
        List(selectedInternalPackages.include(filterLevel === Level.Trace).excludeUnselected)
)

val debugHandler = LogHandler(
    minimumLevel = Some(Level.Debug)
    , writer = fileWriterDebug
    , formatter = mdcFormatter
    , modifiers =
        List(select(
            className("io.milton.http.StandardFilter")
        ).include(filterLevel >= Level.Error)
        )
)

val warnHandler = LogHandler(
    minimumLevel = Some(Level.Warn),
    writer = fileWriterWarn
    , formatter = mdcFormatter
    , modifiers = List(selectedInternalPackages.exclude(filterLevel > Level.Warn).excludeUnselected)
)

val errorHandler = LogHandler(
    minimumLevel = Some(Level.Error),
    writer = fileWriterError
    , formatter = mdcFormatter
)

Logger.root
    .clearHandlers()
    .clearModifiers()
    .withMinimumLevel(Level.Info)
    .withHandler(consoleHandler)
    .withHandler(traceAllHandler)
    .withHandler(traceHandler)
    .withHandler(debugHandler)
    .withHandler(warnHandler)
    .withHandler(errorHandler)
    .replace()

Logger("no.officenet").withModifier(boosted(Level.Debug, Level.Info)).replace()
Logger("com.visena").withModifier(boosted(Level.Debug, Level.Info)).replace()

scribe.Logger("SERVICETIMELOGGER")
    .orphan()
    .clearHandlers()
    .clearModifiers()
    .withHandler(minimumLevel = Some(Level.Info)
        , writer = FileWriter(
            Paths.get(System.getProperty("user.home"), "visena", "logs", moduleName) / ("visena-performance" % dailyRolling % ".log")
        ).flushAsync
        , formatter = mdcFormatter
    )
    .replace()

scribe.Logger("AspectJ Weaver")
    .orphan()
    .clearHandlers()
    .clearModifiers()
    .withHandler(minimumLevel = Some(Level.Info)
        , writer = FileWriter(
            Paths.get(System.getProperty("user.home"), "visena", "logs", moduleName) / ("aspectj" % dailyRolling % ".log")
        ).flushAsync

        , formatter = mdcFormatter
    )
    .replace()
Matt Hicks
@darkfrog26
@andreak I'm not seeing your config...
Andreas Joseph Krogh
@andreak
I always have trouble formatting these blocks...
Matt Hicks
@darkfrog26
why 3.4 instead of 3.5?
Andreas Joseph Krogh
@andreak
Just never got around to upgrade... Are there any specific fixes in 3.5 which affects this?
Matt Hicks
@darkfrog26
I'm actually publishing 3.5.2 right now
yeah, there are several fixes...and some of them specific to file logging
I tried to release 3.5.2 last night but Sonatype died in the middle of the publish
Andreas Joseph Krogh
@andreak
Ah, I'll try 3.5.2 then.
Will report back tomorrow
Matt Hicks
@darkfrog26
you may see some minor breakages, but it should be fairly minimal
Andreas Joseph Krogh
@andreak
Ok
Matt Hicks
@darkfrog26
you may need to wait about an hour for it to sync with central
Andreas Joseph Krogh
@andreak
Ok
Are there any artifact-changes?
I mean, changes in which artifacts are needed (ie. scribe-file)
Matt Hicks
@darkfrog26
no
mostly it is updates to dependencies and support for Scala 3
Andreas Joseph Krogh
@andreak
Ok
Matt Hicks
@darkfrog26
...and bug fixes. :o
Matt Hicks
@darkfrog26
@andreak you'll need 3.5.3 since Sonatype had some strange glitch last night and won't let me publish 3.5.2
it should be sync'd by now
Andreas Joseph Krogh
@andreak
Rock!
Andreas Joseph Krogh
@andreak
Same with 3.5.3; When the log-file exists (created over a month ago) the file is appended to instead of rolled.
Matt Hicks
@darkfrog26
hmmm
@andreak do you want to take a look at the logic and see if you can see where my mistake is?