ETL: Log
Table of Contents
Description
Write string into common Graphlytic log file. Useful to log information during execution of ETL job.
Connection
Parameters
Name | Description | Required | Default |
---|---|---|---|
level | level of log information. Possible values (all Slf4j levels): TRACE, DEBUG, INFO, WARN, ERROR. | no | DEBUG |
log_to_file | toggle writing logs into file. | true | |
log_to_history | toggle writing logs into job history entries. | true |
Query
Not used.
Script
Write string into log file with defined level.
Examples
ETL job writes current date and time into log file.
<!DOCTYPE etl SYSTEM "
https://scriptella.org/dtd/etl.dtd
">
<
etl
>
<
description
>Test log</
description
>
<
connection
id
=
"logInfo"
driver
=
"log"
>
level=WARN
</
connection
>
<
connection
id
=
"groovy"
driver
=
"script"
>language=groovy</
connection
>
<
script
connection-id
=
"groovy"
>
etl.globals['sysStart'] = new Date();
</
script
>
<
script
connection-id
=
"logInfo"
>
start: ${etl.globals['sysStart']}
</
script
>
</
etl
>
Example log connection writing only job history entries (no file output)
<!DOCTYPE etl SYSTEM "
https://scriptella.org/dtd/etl.dtd
">
<
etl
>
<
description
>Test log</
description
>
<
connection
id
=
"logHistory"
driver
=
"log"
>
level=WARN
log_to_file=false
</
connection
>
<
script
connection-id
=
"logHistory"
>
Hello Job History!
</
script
>
</
etl
>