How can I log the MS SQL queries to the TC Management Console?
I would like to write the query to the log (only query, without rows/results).
I use the tDBInput component and the flow is very simple:
I know that for some DB technology (for example Snowflake) the queries (tDBInput and tDBRow) are written to the log automatically but for MS SQL is doesn't work.
Solved! Go to Solution.
The most easy way will be store the query in a context variable and print it using a tJava.
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved
Maybe I'm wrong but simple System.out.println(context.query) puts the query into the output.
But I would like to see the query in the Cloud log.
How can I do it?
Thanks a lot.
I did as you both wrote and it looks ok.
I thought that there is more easier and shorter way to do it so this is why I asked.
Right now If I want to add some log entries/details in a few places in job, it is necessary to add a lot of components to the job.
For example, if I have 10 different queries to run in one job in different places I need to add 10 additional tJava component and 10 additional tJobLog component.
This makes the job difficult to read.
It would be great to have some java function to write some logs (context variables) in both places - to the output and to the cloud log (web).
Do you know if there is something like this?
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Find out about Talend's 2019 Summer release
Talend continues to revolutionize how businesses leverage speed and manage scale
Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend