[logback-user] logback.groovy configuration throws errors
Tompi Mat
thauer.spam at gmail.com
Wed Nov 9 19:42:11 CET 2011
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
^
On 11/09/2011 07:38 PM, ceki wrote:
>
> The following lines from your logback.groovy file are most probably
> not be needed and look rather suspicious. (I am aware of what @Grab
> does.)
>
> @Grab('ch.qos.logback:logback-core:1.0.0')
> @Grab('ch.qos.logback:logback-classic:1.0.0')
> @Grab('ch.qos.logback:logback-examples:1.0.0')
>
> What happens when you remove them?
>
> On 09.11.2011 19:26, Tompi Mat wrote:
>> Hi
>>
>> Well, this is exactly what does not work as I intended to show in my
>> original email.
>>
>> Unless I massively misunderstood something
>> Tamas
>>
>>
>>
>> On 11/09/2011 07:20 PM, ceki wrote:
>>> You just place logback.groovy file on your class path and it will be
>>> picked up by logback to configure itself much in the same way as
>>> logback.xml files are picked up for configuration. I hope this helps,
>>> --
>>> Ceki
>>> On 09.11.2011 18:57, Tompi Mat wrote:
>>>> Hi
>>>>
>>>> Thanks a lot for the prompt reply! What I don't quite understand at
>>>> this point is users are encouraged to use them or not.
>>>>
>>>> It looks like logback.groovy files are in the way, anyhow - I am not
>>>> explicitly executing it but it is picked up by the HelloWorld.groovy
>>>> just to throw the error I mentioned.
>>>>
>>>> I much prefer groovy DSL to XML but I have not found any clues as
>>>> to how
>>>> logback.groovy is to be used and it puzzles me what the benefit of the
>>>> XML->groovy translators are?
>>>>
>>>> Thanks a lot
>>>>
>>>> Tamas
>>>>
>>> _______________________________________________
>>> Logback-user mailing list
>>> 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
>
>
More information about the Logback-user
mailing list