Skip to content
Revolutionary high-performance Groovy/Java Slf4j logger
Groovy Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src Sync with Maven Central. Aug 13, 2019
.gitignore Build.gradle updates and formatting as per recommendations from @virt… Feb 10, 2019
.travis.yml
LICENSE
README.md
build.gradle
conventions.groovy
gradlew
gradlew.bat
settings.gradle

README.md

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.

❇ Bobbin is available both in JCenter and Maven Central repositories.

Maven

❗ Note that there is no <type>pom</type>

Example Maven project with Bobbin

        <dependency>
            <groupId>io.i-t</groupId>
            <artifactId>bobbin</artifactId>
            <version>2.0.11</version>
        </dependency>

Gradle

dependencies {
    compile "org.codehaus.groovy:groovy-all:2.5.4"
    compile "io.i-t:bobbin:2.0.11"
}

Try it now!

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

@Grab('io.i-t:bobbin:2.0.11')
@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)"
    }
  ]
}
You can’t perform that action at this time.