Skip to the content.

Infinite Technology ∞ Bobbin 📼

…The Bobbin revolves infinitely…

…A revolution in Java logging…

Attribute\Release type Latest Stable
Version 3.0.0-SNAPSHOT 2.0.x
Branch master BOBBIN_2_0_X
CI Build status Build Status Build Status
Test coverage codecov codecov
Library (Maven) oss.jfrog.org snapshot Download

Bobbin is a high-performance Groovy Slf4j-compatible logger designed for multi-threaded applications (especially those with persistent threads like batch and messaging applications).

Bobbin leverages the concept of Logback/Log4j2 sifting appenders while providing much more easier configuration using native Groovy/Java scripting expressions.

Gradle

repositories {
    jcenter()
}
dependencies {
    compile "org.codehaus.groovy:groovy-all:2.5.4"
    compile "io.infinite:bobbin:2.0.4"
}

Try it now!

Just simply run the below code in Groovy (2.5.4+) console:

@Grab('io.infinite:bobbin:2.0.4')
@Grab('org.slf4j:slf4j-api:1.7.25')
import groovy.util.logging.Slf4j

@Slf4j
class TryMe {
    
    void tryMe() {
        log.info("Welcome to the revolution in Java Logging.")
    }

}

new TryMe().tryMe()

Output:

2019-03-15 15:19:14:337|info|Thread-3|TryMe|Welcome to the revolution in Java Logging.

Documentation

Sample configuration

Bobbin.json

{
  "levels": "['debug', 'info', 'warn', 'error'].contains(level)",
  "destinations": [
    {
      "name": "io.infinite.bobbin.destinations.FileDestination",
      "properties": {
        "fileName": "\"./LOGS/PLUGINS/INPUT/${className}/${level}/${className}_${level}.log\""
      },
      "classes": "className.contains('conf.plugins.input')"
    },
    {
      "name": "io.infinite.bobbin.destinations.FileDestination",
      "properties": {
        "fileName": "\"./LOGS/PLUGINS/OUTPUT/${className}/${level}/${threadName}_${level}_${date}.log\""
      },
      "classes": "className.contains('conf.plugins.output')"
    },
    {
      "name": "io.infinite.bobbin.destinations.FileDestination",
      "properties": {
        "fileName": "\"./LOGS/THREADS/${threadGroupName}/${threadName}/${level}/${threadName}_${level}_${date}.log\""
      },
      "classes": "className.contains('io.infinite.')"
    },
    {
      "name": "io.infinite.bobbin.destinations.FileDestination",
      "properties": {
        "fileName": "\"./LOGS/ALL/WARNINGS_AND_ERRORS_${date}.log\""
      },
      "levels": "['warn', 'error'].contains(level)"
    },
    {
      "name": "io.infinite.bobbin.destinations.ConsoleDestination",
      "levels": "['warn', 'error'].contains(level)"
    }
  ]
}