Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
anu2
Contributor
Contributor

How to Disable log 4j INFO Settings in Child Job for TDBROW component to avoid printing SQL Statements in Log File

Hi,

In Project level settings we have enabled Log 4j root level Info, In this project we have two jobs like one is parent while triggering time that Job will call another sub job as per the frame work. In That sub job we have TDB row component, that component generating insert statements for each record in Log file. we can't do batch process as per the frame work, by default job reading row by row and inserting into the DB using TDB Row Component.

Please suggest me , Is there any chance to avoid print these SQL statements in Logfile while running time.

Labels (3)
7 Replies
Anonymous
Not applicable

Hello,

You are able to customize log4j output level at runtime.

For more information, please refer to this online documentation:

https://help.talend.com/r/en-US/8.0/studio-user-guide-data-integration/customizing-log4j-output-leve...

Best regards

Sabrina

 

Anonymous
Not applicable

Hello,

 

2 options:

You can increase the log level of that child job to WARN which would totally disable the INFO level logs.

You can also create log4j filters and fine-tune the logs, here you have an article how to customize the log4j.xml (it's for v1, v2 syntax is different but it has RegexFilter and such so should be easier) https://community.talend.com/s/article/Log-j-tips-and-tricks-I8730?language=en_US

anu2
Contributor
Contributor
Author

Hello,

We have tried with filters tag and Regrex filter in log4j2 but it did not worked with our system.

we are not able to filter particulter logs in log files.

Please find below configurations which we have used.

With Regrex filter:-

<?xml version="1.0" encoding="UTF-8"?>

<Configuration>

 <Appenders>

  <RollingFile name="RollingFile" fileName="${sys:TalendJob.log}"         

   filePattern="logs/app-%d{MM-dd-yyyy}.log.gz">

   <RegexFilter regex=".* Execute the query .*" onMatch="DENY" onMismatch="ACCEPT"/>

   <PatternLayout>

    <pattern>[%p] %d %c %M - %m%n</pattern>

   </PatternLayout>

   <TimeBasedTriggeringPolicy />

  </RollingFile>

 </Appenders>

 <Loggers>

  <Root level="INFO">

   <AppenderRef ref="RollingFile"/>

  </Root>

 </Loggers>

</Configuration>

With Filter tag:- 

<?xml version="1.0" encoding="UTF-8"?>

<Configuration>

        <Appenders>

                <Console name="Console" target="SYSTEM_OUT">

                        <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" />

                         <Filters>

    <Filter type="RegexFilter" regex=".* Execute the query .*" onMatch="DENY" onMismatch="ACCEPT"/>

   </Filters>

                </Console>

                <File name="File" fileName="${sys:TalendJob.log}" >

                        <PatternLayout>

                                <Pattern>[%p] %d %c %M - %m%n</Pattern>

                        </PatternLayout>

                </File>

        </Appenders>

        <Loggers>

                <Logger name="TalendLog" >

                        <AppenderRef ref="Console" level="INFO"/>

                        <AppenderRef ref="File" level="INFO"/>

                </Logger>

                <Root level="INFO">

                        <AppenderRef ref="Console" />

                        <AppenderRef ref="File" />

                </Root>

        </Loggers>

</Configuration>

 

The tdbRow Component generates below log in the logfile for each row that needs to be inserted in the table. This is not custom log and this is coming from tdbRow component only.

We need to remove this log generated by "tdbRow " component from logfile. We have have applied Regex Filter on "Execute the query " to suppress this log from the log file but it is not working. Maybe the regex expression that we have applied is not correct.

 

Could you please let us know the correct regex expression for the below log so as to suppress the log from tdbRow component using RegexFilter ?

 

 

2022-07-05 18:14:14 INFO jb_process_in_delim:13080 - tOracleRow_4 - Execute the query: '

BEGIN    

 

insert into <<Table_Name>> (interface_name,source_id,record_id  , DESC1 , DESC2 ) values('Dummy_interface', 'Dummy.csv' ,'1' , 'dummy.CSV' , 'OK' ) ;

  

commit;

 

END ;

 

' has finished 

 

  

Kindly Suggest..

 

Thanks In Advance..

Anonymous
Not applicable

Hello,

Could you please clarify in which Talend version/edition you are?

Best regards

Sabrina

anu2
Contributor
Contributor
Author

Hi,

 

Present we are using Talend DI 7.3.1 enterprise edition

 

Regards,

Anusha

anu2
Contributor
Contributor
Author

Hi Sabrina,

Hope you are doing well,

Please let me know that, any update regarding the correct regex expression for the below log so as to suppress the log from tdbRow component using RegexFilter ?

 

2022-07-05 18:14:14 INFO jb_process_in_delim:13080 - tOracleRow_4 - Execute the query: '

BEGIN    

 

insert into <<Table_Name>> (interface_name,source_id,record_id  , DESC1 , DESC2 ) values('Dummy_interface', 'Dummy.csv' ,'1' , 'dummy.CSV' , 'OK' ) ;

 

 

Kindly suggest,

 

Thanks,

Anusha.

Anonymous
Not applicable

Hello,

Sorry for getting back to you so late.

With your subscription solution, would you mind raising a support case on talend support portal so that we could give you a remote assistance on your issue through support cycle with priority.

Best regards

Sabrina