How can Scriptella generate a log file?
I want Scriptella to generate a log file for each raw file to be ETLed just a log4j does for a java application. How to make this possible?
<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd"> <etl> <connection id="log4j" driver="script"/> <connection id="jul" driver="script"/> <script connection-id="jul"> java.util.logging.Logger.getLogger("testLogger").info("This is JUL message"); </script> <script connection-id="log4j"> //For demo purposes!!! //Configures log4j to use console for output //Normally log4j should be configured by using a config file org.apache.log4j.BasicConfigurator.configure(); </script> <script connection-id="log4j"> org.apache.log4j.Logger.getLogger("testLoggerName").info("This is LOG4J message"); </script> </etl>
You can declare a connection like this
<connection id="log" driver="text" url="D:/tmp/out.log"/>
and then use it in your query like this
<query connection-id="dbConnectionIn"> select * from table <script connection-id="log"> Result $column1, $comun2 </script> </query>
This will now log it to the file under D:/tmp