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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
nfz11
Creator III
Creator III

tJobLog "log cannot be resolved" Java compile error when log4j turned off for project.

Hi, I am getting an error "log cannot be resolved" from my tJobLog if I have log4j disabled for my project.  I want to keep 'Activate log4j for project' unchecked in my project properties because I do not want verbose logging from other components.

 

				currentComponent = "tJobLog_1";

				org.apache.log4j.Level logPriority_tJobLog_1 = org.apache.log4j.Level
						.toLevel(20000);
				String message_tJobLog_1 = String
						.valueOf("Number of cases created for applications: "
								+ globalMap.get("tJavaRow_6_NB_LINE")
								+ ", "
								+ "Number of applications skipped because of existing case: "
								+ globalMap.get("tWarn_1_NB_LINE") + ".");

				org.apache.log4j.MDC.put("ticLogLevel", "2");
		                log.log(logPriority_tJobLog_1, message_tJobLog_1);
				org.apache.log4j.MDC.remove("ticLogLevel");

 Do I have to keep log4j enabled to use tJobLog?

 

Thanks in advance for any help.

Labels (3)
1 Solution

Accepted Solutions
nfz11
Creator III
Creator III
Author

I think I do have to enable log4j if I want to use the tJobLog component which seems like a fair design requirement.  I found a way to change the log4j run level from debug to info when I run the job so that eliminated the extraneous log messages.  I am going to mark this as resolved.

View solution in original post

1 Reply
nfz11
Creator III
Creator III
Author

I think I do have to enable log4j if I want to use the tJobLog component which seems like a fair design requirement.  I found a way to change the log4j run level from debug to info when I run the job so that eliminated the extraneous log messages.  I am going to mark this as resolved.