Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Please confirm that tlogcatcher component function only if "Die on error" is ticked for DB connection.

Team,

Please clarify on my understanding about the tlogcatcher component.

 

If I want to catch the error without need to check the die on error in DB output component like PostgreSQL output component(as I don't to stop the execution in case any error comes).0683p000009M6tS.jpgDoes tlogcatcher work if "Die on error" will be unchecked?....It seems to me that's not possible with tlogcatcher and then I have only option left is to use tredirectcomponent and that will only redirect to file and I was thinking to do log in tables.

 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

There is a way around this if you are not wishing to ensure your data is correct before loading. What you can do is put a tPostJob at the end of your job and link a component to it to read a file (I'll explain the file later). The file will have your errrors in it. You can then send the file data to your database. The tPostJob will ALWAYS run, even if your job fails to finish.

 

Regarding the file, you can configure the contents of the output window to be sent to a file. Your db errors will be sent to the output window automatically. To send this to a file you can follow this little trick I have written here: https://community.talend.com/t5/How-Tos-and-Best-Practices/Redirect-the-output-from-the-console-to-a...

 

Make sure to read the whole thread as people have added some interesting comments.

 

This will require a little playing around to get it to suit your exact requirement, but this is the route I would take. Good luck.

View solution in original post

5 Replies
Anonymous
Not applicable
Author

The log catcher doesn't really work this way, particularly when it comes to db errors. However, this can be worked around using a few tricks.

With the tDBOutput for PostgreSQL you can enable a "Rejects" output if you switch off the tDie and the "Use Batch Size" option (on the Advanced tab). This will allow you to log your insert/update errors without stopping the job.

Anonymous
Not applicable
Author

Thanks for your reply.

So, the thing is that we actually need the batch functionality as well due to huge records count and need to improve the performance but at the same time I was expecting that if, without stopping the DB load job for any error like "value too long " or so...the DB error will be catch and loaded into the DB.

 

Anonymous
Not applicable
Author

I believe (but I am not an expert in PostgreSQL, so am happy to be corrected) that sending the data as a batch with errors will cause the batch to fail (potentially after the first record to fail or maybe the whole batch....as I said, I do not use PostgreSQL). If you are expecting errors like "value too long", etc, maybe it would be a better idea to validate the records against the schema before submitting them using a tSchemaComplianceCheck component.

Anonymous
Not applicable
Author

Thanks again for your response.

Yes, per my testing on this issue.

 

1. If die on error is unchecked and batch is selected the tlogcatcher doesn't load the error in DB instead it only log the error in DB when the die on error is checked hence, this doesn't fulfil my requirement where I need to log any DB error  comes to run console without stopping the jobs.

 

2. I see only solution is to use tredirectoutput component to log in file as DB logging is not possible for my case.

 

I hope you do agree for such scenario as no other way to log in DB until unless,I load the file output from 

error file to DB that again very tricky0683p000009MACn.png0683p000009MACn.png

Anonymous
Not applicable
Author

There is a way around this if you are not wishing to ensure your data is correct before loading. What you can do is put a tPostJob at the end of your job and link a component to it to read a file (I'll explain the file later). The file will have your errrors in it. You can then send the file data to your database. The tPostJob will ALWAYS run, even if your job fails to finish.

 

Regarding the file, you can configure the contents of the output window to be sent to a file. Your db errors will be sent to the output window automatically. To send this to a file you can follow this little trick I have written here: https://community.talend.com/t5/How-Tos-and-Best-Practices/Redirect-the-output-from-the-console-to-a...

 

Make sure to read the whole thread as people have added some interesting comments.

 

This will require a little playing around to get it to suit your exact requirement, but this is the route I would take. Good luck.