Add logging capability to a Groovy script (unit)

21 Jan '13, 12:12 PM
14,894 Views
No Forum Badges

Hello,

I have tried to a Script unit as follows:

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
...
private static def log = LogFactory.getLog(getClass());
log.debug("CIAO");
...

but I always get the following error:

21 gen 2013 11:32:35,361  ERROR [http-3308-6]  (com.webratio.units.utility.rtx.ScriptUnitService:195) - [scu9r][CreatePDF]Unable to execute the script
 org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.IllegalArgumentException: **argument type mismatch**

What is the correct way to log data from within a Script unit (WebRatio 5.1.x)?

Thanks, Salvatore

 
x 0
Follow
Answer Answer at this question and get points!
No Forum Badges

Ok, I found the correct way of doing it:

private static def log = LogFactory.getLog(com.webratio.rtx.core.DefaultRTXManager.class);
log.debug("CIAO");

I had to use com.webratio.rtx.core.DefaultRTXManager.class

   
x 1
Answer at this question and get points!

Related questions

add html Add select all to Checkable List AJAX events problem to external JavaScript Automatic file upload Build Project. Only files for compilation .class Cannot invoke method selectSingleNode() on null object Can't run any aplication Content module page variable won't assign. Convert selector component result to single value Criptare dati sensibili nel database Data flow from a page which is not visible anymore Debug configuration Deploy de proyecto en HTTPS Execute truncate sql query file analysis then update MySQL database "Generation Error" with Generate and Run Get size of Multi Form with Pictures Object Array Getting the absolute path of a RTXBLOBData Groovy and Database Groovy script numer after an error Hide form until a flow is triggered Hiding landmarks (or flows) when the user is logged in How can I add a credit card payment gateway or integrate paypal in my web app logic? How can i add html into a page? how can i open a pdf file using download dialog How to calculate dates between start and end point? How to Retreive data from Multi Selection Field Array Importing JAR Libraries into Script Unit Importing jar library JAR importing Logs in page Merge the result of 2 (or more) flows [MOBILE] Script doesn't work! Modify generated code / inject own HTML, Javascript code into existing generted code. Problem with application runnung Retrieve a value and add some value to it Schedule a Job when adding a record to the database script component Script eseguito alla User Login Script Unit e Mysql ScritpUnit and JSON data Setting Upload directory Shuffling Script Standard confirm dialog replacement Unable to execute the script java.lang.NullPointerException Unable to use Visual Debug Unknow property on Dynaclass after generation upload file and the move it to other location WebRatio 6.1.2: Groovy Version / Versione Groovy WebRatio Mobile on Linux using wrong network interface.