[logback-user] logback.groovy configuration throws errors

Tompi Mat thauer.spam at gmail.com
Wed Nov 9 22:04:18 CET 2011


I don't know much about classloading but is not logback.xml loaded by
logback.jar as well?

(@Grab puts the jars on the classpath, too - I am completely happy with
@Grab-bing logback dependencies from HelloWorld.groovy, see the original
post)

Tamas


On 11/09/2011 09:13 PM, Chris Pratt wrote:
> Being that the code that loads logback.groovy is within logback.jar, I
> don't see any way around having at least that jar on the classpath.
>   (*Chris*)
>
> On Wed, Nov 9, 2011 at 12:09 PM, Tompi Mat <thauer.spam at gmail.com
> <mailto:thauer.spam at gmail.com>> wrote:
>
>     Hi,
>
>     In the examples I have shown so far, nothing has been on my classpath
>     except for the directory containing logback.groovy.  I.e.
>     slf4j-api was
>     @Grab-bed in HelloWorld.groovy.
>
>     Removing all the @Grabs from both HelloWorld.groovy and logback.groovy
>     and placing all the jars on the classpath indeed works.
>
>     Of course this is not a path I want to go, while I would love to use
>     logback.groovy instead of logback.xml, the latter beats having jars
>     around instead of @Grabs
>
>     While this is a serious problem for me I am surprised that noone
>     else is
>     running into this?
>
>     Thanks a lot for the discussion, I am looking forward to news that
>     this
>     may some day be fixed.
>
>     Cheers, I really appreciate your work
>
>     Tamas
>
>     On 11/09/2011 07:51 PM, ceki wrote:
>     >
>     > Have you tried placing logback-core.jar and logback-classic.jar on
>     > your class path in the same way that slf4j-api.jar is.
>     >
>     > On 09.11.2011 19:42, Tompi Mat wrote:
>     >> After removing the @Grabs:
>     >>
>     >> $ groovy HelloWorld.groovy
>     >> 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.encoder.PatternLayoutEncoder
>     >>   @ line 1, column 1.
>     >>     import ch.qos.logback.classic.encoder.PatternLayoutEncoder
>     >>     ^
>     >>
>     >> Script1.groovy: 2: unable to resolve class
>     >> ch.qos.logback.core.ConsoleAppender
>     >>   @ line 2, column 1.
>     >>     import ch.qos.logback.core.ConsoleAppender
>     >>     ^
>     >>
>     >> Script1.groovy: 4: unable to resolve class
>     ch.qos.logback.classic.Level
>     >>   @ line 4, column 1.
>     >>     import static ch.qos.logback.classic.Level.DEBUG
>     >>     ^
>     >
>     >
>
>     _______________________________________________
>     Logback-user mailing list
>     Logback-user at qos.ch <mailto:Logback-user at qos.ch>
>     http://mailman.qos.ch/mailman/listinfo/logback-user
>
>
>
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20111109/79542fcc/attachment-0001.html>


More information about the Logback-user mailing list