
Ah...that's a lot better :-) Got my log file now! Cheers Lance
-----Original Message----- From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Ceki Gülcü Sent: 30 June 2010 14:50 To: logback users list Subject: Re: [logback-user] Groovy Configuration
The run method expects a URL, a File or the script itself (as a String). Try this:
gafferConfigurator.run(new File("c:/tmp/aaa.groovy"));
On 30/06/2010 3:43 PM, Lance White wrote:
Afraid not...
I seem to get a variety of errors depending on what the script file is...
With a script file called 'aaa.groovy' in the current working directory (c:\tmp) :
If I call gafferConfigurator.run("aaa.groovy"); or I call gafferConfigurator.run("c:/tmp/aaa.groovy"); then I get
groovy.lang.MissingPropertyException: No such property: aaa for class: Script1 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecode Adapter.java:49) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(Po goGetPropertySite.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectG etProperty(AbstractCallSite.java:241) at Script1.run(Script1.groovy:1) at Script1$run.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSite Array.java:40) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCall Site.java:117) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCall Site.java:121) at ch.qos.logback.classic.gaffer.GafferConfigurator.run(GafferConfigurator .groovy:58) at test.test3.run(test3.java:32) at test.test3.main(test3.java:59)
whereas if I call gafferConfigurator.run("c:\\tmp\\aaa.groovy"); I get
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script1.groovy: 1: unexpected char: '\' @ line 1, column 3. C:\tmp\aaa.groovy ^
1 error
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector. java:296) at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector .java:143) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java :113) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java :125) at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:353) at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrPa rserPlugin.java:99) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin. java:71) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:249) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java :160) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(Compilat ionUnit.java:845) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(Compilatio nUnit.java:521) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(Comp ilationUnit.java:497) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.jav a:474) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:292) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727) at groovy.lang.GroovyShell.parse(GroovyShell.java:739) at groovy.lang.GroovyShell.parse(GroovyShell.java:766) at groovy.lang.GroovyShell.parse(GroovyShell.java:757) at groovy.lang.GroovyShell$parse.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSite Array.java:40) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCall Site.java:117) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCall Site.java:125) at ch.qos.logback.classic.gaffer.GafferConfigurator.run(GafferConfigurator .groovy:47) at test.test3.run(test3.java:34) at test.test3.main(test3.java:61)
Cheers
Lance
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user