Skip to content

Instantly share code, notes, and snippets.

@aeg
Created September 5, 2012 16:32
Show Gist options
  • Save aeg/3639472 to your computer and use it in GitHub Desktop.
Save aeg/3639472 to your computer and use it in GitHub Desktop.
Groovy slf4j Test
package org.eiji
@Grapes([
@Grab(group='org.slf4j', module='slf4j-log4j12', version='1.6.6'),
@Grab(group='ch.qos.logback', module='logback-classic', version='0.9.28')
]
)
import org.slf4j.Logger
import org.slf4j.LoggerFactory
def logger = LoggerFactory.getLogger(this.class)
println logger.getName()
logger.trace("TRACE")
logger.info("INFO")
logger.debug("DEBUG")
logger.error("ERROR")
println "hello world\n"
@aeg
Copy link
Author

aeg commented Sep 5, 2012

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/Users/aeg/.groovy/grapes/ch.qos.logback/logback-classic/jars/logback-classic-0.9.28.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/Users/aeg/.groovy/grapes/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.selector.DefaultContextSelector]
org.eiji.GroovyTest
01:29:22.028 [main] INFO org.eiji.GroovyTest - INFO
01:29:22.031 [main] DEBUG org.eiji.GroovyTest - DEBUG
01:29:22.032 [main] ERROR org.eiji.GroovyTest - ERROR
hello world

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment