[GRADLE-2707] logback and gradle Created: 14/Mar/13  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.4
Fix Version/s: None

Type: Bug
Reporter: Mihai CAZACU Assignee: Unassigned
Resolution: Won't Fix Votes: 0

Attachments: File test.7z    

 Description   

Please read the discussion here:

http://logback.10977.n7.nabble.com/logback-and-gradle-td11525.html#a11545

Thanks,
Mihai



 Comments   
Comment by Mihai CAZACU [ 14/Mar/13 ]

Here is the discussion:

Hi,

I need some help to integrate logback into my app.
I use gradle to automate the building and this error occurs when running "gradlew runMod" task:

[configuration ':archives', configuration ':compile', configuration ':default', configuration ':groovy', configuration ':provided', configuration ':runtime', configuration ':signatures', configuration ':testCompile',configuration ':testRuntime']
:cleanModsDir
:clean
BUILD SUCCESSFUL

Total time: 5.028 secs
Download https://oss.sonatype.org/content/repositories/snapshots/io/vertx/vertx-core/2.0.0-SNAPSHOT/vertx-core-2.0.0-20130311.090856-218.jar
Download https://oss.sonatype.org/content/repositories/snapshots/io/vertx/vertx-platform/2.0.0-SNAPSHOT/vertx-platform-2.0.0-20130311.090922-217.jar
[configuration ':archives', configuration ':compile', configuration ':default', configuration ':groovy', configuration ':provided', configuration ':runtime', configuration ':signatures', configuration ':testCompile', configuration ':testRuntime']
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
Download https://oss.sonatype.org/content/repositories/snapshots/io/vertx/lang-groovy/1.0.0-SNAPSHOT/lang-groovy-1.0.0-SNAPSHOT.zip
:compileJava UP-TO-DATE
:compileGroovy
:processResources
:classes
:copyMod
:runMod
println: before test.start
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/c:/Users/mihai/Desktop/test/mods/mod-owner~mod-name~1.0.0-SNAPSHOT/lib/logback-classic-1.0.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/mihai/.gradle/wrapper/dists/gradle-1.4-bin/47n6g3pbi5plc7n8fn58nkinje/gradle1.4/lib/logback-classic-1.0.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 1: unable to resolve class ch.qos.logback.classic.Level
@ line 1, column 1.
import ch.qos.logback.classic.Level
^
Script1.groovy: 5: unable to resolve class ch.qos.logback.core.rolling.TimeBasedRollingPolicy
@ line 5, column 1.
import ch.qos.logback.core.rolling.TimeBasedRollingPolicy
^

Script1.groovy: 4: unable to resolve class ch.qos.logback.core.rolling.RollingFileAppender
@ line 4, column 1.
import ch.qos.logback.core.rolling.RollingFileAppender
^
Script1.groovy: 3: unable to resolve class ch.qos.logback.core.ConsoleAppender
@ line 3, column 1.
import ch.qos.logback.core.ConsoleAppender
^
Script1.groovy: 6: unable to resolve class ch.qos.logback.core.status.OnConsoleStatusListener
@ line 6, column 1.
import ch.qos.logback.core.status.OnConsoleStatusListener
^

Script1.groovy: 2: unable to resolve class ch.qos.logback.classic.encoder.PatternLayoutEncoder
@ line 2, column 1.
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
^
Script1.groovy: 8: unable to resolve class ch.qos.logback.classic.Level
@ line 8, column 1.
import static ch.qos.logback.classic.Level.INFO
^
Script1.groovy: 9: unable to resolve class ch.qos.logback.classic.Level
@ line 9, column 1.
import static ch.qos.logback.classic.Level.WARN
^
8 errors

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:927)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:575)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:524)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:613)
at groovy.lang.GroovyShell.parse(GroovyShell.java:625)
at groovy.lang.GroovyShell.parse(GroovyShell.java:652)
at groovy.lang.GroovyShell.parse(GroovyShell.java:643)
at groovy.lang.GroovyShell$parse.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at ch.qos.logback.classic.gaffer.GafferConfigurator.run(GafferConfigurator.groovy:48)
at ch.qos.logback.classic.gaffer.GafferConfigurator$run.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at ch.qos.logback.classic.gaffer.GafferConfigurator.run(GafferConfigurator.groovy:37)
at ch.qos.logback.classic.gaffer.GafferUtil.runGafferConfiguratorOn(GafferUtil.java:43)
at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:65)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
at test.Test.start(Test.groovy:20)
at org.vertx.groovy.platform.Verticle.start(Verticle.groovy:35)
at org.vertx.groovy.platform.Verticle$start.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.vertx.groovy.platform.impl.GroovyVerticle.start(GroovyVerticle.groovy:59)
at org.vertx.java.platform.impl.DefaultPlatformManager$11.run(DefaultPlatformManager.java:1171)
at org.vertx.java.core.impl.Context$1.run(Context.java:127)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:366)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:290)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
11:27:25,808 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.groovy] at file:/c:/Users/mihai/Desktop/test/mods/mod-owner~mod-name~1.0.0-SNAPSHOT/logback.groovy

println: after test.start
CTRL-C to stop server
> Building > :runMod

The sample app can be found in the attachment. Just unpack and run "gradlew runMod".

Thanks,
Mihai

Comment by Mihai CAZACU [ 20/Mar/13 ]

Have you looked at this issue?
Thanks, Mihai

Comment by Mihai CAZACU [ 26/Mar/13 ]

Have you looked at this issue?
Thanks, Mihai

Comment by Adam Murdoch [ 27/Mar/13 ]

Can you post your problem to the Gradle forums at http://forums.gradle.org, thanks.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:29:18 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.