Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

tRestClient and Log4j warnings

Hi - I'm seeing some strange behavior that I'm hoping someone can advise me on.  I have been building jobs using TOS-DI 6.1.1 for a while now. In these jobs, I have been using a tRestClient component in the same way across all jobs.  The service being called in the tRestClient is an TOS-ESB service that I've created and deployed into an TOS-ESB Runtime.  This all works great for me.  Since all of my jobs use this same service call, what I've been doing is when I create a new DI job, I start by copying and pasting the subjob that includes the tRestClient call, along with other dependent components.  
Anyways, this has been working just fine for me.  The jobs that I create all behave as expected.  Within the last few days, I've come across some very strange behavior.  When I create a new job (within the same Project) and export the job to be run from the command line, I'm now getting these warnings:

log4j:WARN No appenders could be found for logger (org.apache.cxf.common.logging.LogUtils).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

I've isolated these warning as coming from my tRestClient component.  They do not appear when running the job via Studio, only when building the job and running at the command line.  What's strange about this is that jobs (again within the same project) that I created before a couple days ago all behave normally, with no warning messages.  Even if I re-export those older jobs, they continue to behave fine.  Any new jobs I create, once exported, are giving me these warning messages.

Ultimately, I don't want to use log4j.  I feel like something in my TOS environment must have changed, but I can't seem to figure out what that may be.  Additionally, I don't understand why this issue is only surfacing with newly created jobs.

I did find that if I add this snippet into a tJava component, that gets rid of the warnings, but then my job output spits out a ton of logging messages, which I don't want/need:
org.apache.log4j.BasicConfigurator.configure();

Any thoughts or advice?

Labels (2)
1 Reply
_AnonymousUser
Specialist III
Specialist III
Author

In the meantime, I've added a tJava component prior to the subjob that calls the tRestClient component.  In that tJava, I now have these two lines:
org.apache.log4j.BasicConfigurator.configure();
org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.INFO);

The first line sets up the log4j configuration, getting rid of the WARN messages.  The second line sets the logging level to INFO, getting rid of all of the DEBUG messages that are then generated.  This will work for me, but I still don't understand why jobs created prior to a couple days ago had no issues with log4j and why new jobs since then do have these issues.
very strange...