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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Logging to a file

I was wondering if anyone knew how to implement logging to a file in Camel? I have read of all the documentation and its still not clear to me how to accomplish it...
I have several logs in my route and I would like to log those in one location. I also want to log the exceptions that I am catching.

Labels (2)
11 Replies
Anonymous
Not applicable
Author

See this post https://community.talend.com/t5/Design-and-Development/sl4j-or-log4j-logging/td-p/7705 regarding issues using slf4j. I will see if I can do a quick example with a cbean for you.
Anonymous
Not applicable
Author

Haven't updated this post, but I finally got it working. here is how the code looks in the bean.
Thanks for the help Ed!
package beans;
import java.io.File;
import org.apache.camel.Body;
import org.apache.camel.Header;
import org.apache.camel.Property;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;

public class Log2 {
final Logger logger = LoggerFactory.getLogger("myAppender");

public void logMessage(){

logger.info("This is logging from a Bean");
}

}