<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [resolved] Logging to a file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284207#M57953</link>
    <description>I figured out that you can turn on logging for each container by enabling sift logging in the &amp;lt;TALENDESB&amp;gt;/container/etc/org.ops4j.pax.logging.cfg file, but I dont see it logging for my deployed containers.  If I turn on debug it does some logging saying that my route is starting, but after that it doesnt log anything.  Is there something I am missing here?  Has anyone gotten this to work?</description>
    <pubDate>Tue, 12 Jun 2012 23:33:55 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-06-12T23:33:55Z</dc:date>
    <item>
      <title>[resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284204#M57950</link>
      <description>&lt;P&gt;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... &lt;BR /&gt;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.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 12:16:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284204#M57950</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284205#M57951</link>
      <description>hi Dave
&lt;BR /&gt;Use the camel-log component for logging the current message using log4j. See 
&lt;A href="http://camel.apache.org/log.html" rel="nofollow noopener noreferrer"&gt;http://camel.apache.org/log.html&lt;/A&gt; . In Studio this is available using the cMessageEndpoint in 5.0.2. It may have its own icon in 5.1.1.
&lt;BR /&gt;Use the log eip to log messages, see 
&lt;A href="http://camel.apache.org/logeip.html" rel="nofollow noopener noreferrer"&gt;http://camel.apache.org/logeip.html&lt;/A&gt;. In Studio 5.0.2 use the JavaDSL to implement the log eip.
&lt;BR /&gt;For error handling see 
&lt;A href="http://camel.apache.org/error-handler.html" rel="nofollow noopener noreferrer"&gt;http://camel.apache.org/error-handler.html&lt;/A&gt; . I would suggest using the error handler with the exception handler rather than the try-catch components.
&lt;BR /&gt;Note that some exceptions thrown by endpoints (rather than occurring within the eip's and processors) may result in faults rather than exceptions.
&lt;BR /&gt;Note that there is a LoggingErrorHandler available out-of-the-box.
&lt;BR /&gt;Some exceptions thrown by endpoints will result in faults. By default these are not handled by exceptions unless you set handleFault to true. This can be set on the context or route scope using setHandleFault(true) or handleFault() respectively.</description>
      <pubDate>Wed, 06 Jun 2012 01:38:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284205#M57951</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-06T01:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284206#M57952</link>
      <description>Thanks Ed.  I am using the log and exception handler (I will look into the error-handler). &lt;BR /&gt;I guess what I meant to ask is right now Talend logs everything to the tesb.log folder is there a way to log to a specific file and not just the tesb.log file?  I would like to log to a different directory for each project that I have.  I could write a bean and use log4j to do what I need to do but I wanted to see if there was something built in that would do it for me.</description>
      <pubDate>Thu, 07 Jun 2012 17:01:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284206#M57952</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-07T17:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284207#M57953</link>
      <description>I figured out that you can turn on logging for each container by enabling sift logging in the &amp;lt;TALENDESB&amp;gt;/container/etc/org.ops4j.pax.logging.cfg file, but I dont see it logging for my deployed containers.  If I turn on debug it does some logging saying that my route is starting, but after that it doesnt log anything.  Is there something I am missing here?  Has anyone gotten this to work?</description>
      <pubDate>Tue, 12 Jun 2012 23:33:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284207#M57953</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-12T23:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284208#M57954</link>
      <description>This is really just a log4j question. What you need to do is first set up a new appender. For example: 
&lt;BR /&gt; 
&lt;PRE&gt;log4j.appender.myAppender=org.apache.log4j.RollingFileAppender &lt;BR /&gt;log4j.appender.myAppender.layout=org.apache.log4j.PatternLayout &lt;BR /&gt;log4j.appender.myAppender.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %C | %-32.32C %4L | %m%n &lt;BR /&gt;log4j.appender.myAppender.file=${karaf.data}/log/myLog.log &lt;BR /&gt;log4j.appender.myAppender.append=true &lt;BR /&gt;log4j.appender.file.maxFileSize=1MB &lt;BR /&gt;log4j.appender.myAppender.maxBackupIndex=10&lt;/PRE&gt; 
&lt;BR /&gt;Then attach the appender to a logger 
&lt;BR /&gt; 
&lt;PRE&gt;log4j.logger.myLogger=INFO,myAppender&lt;/PRE&gt; 
&lt;BR /&gt;Now specify the logger as the in camel-log component. If you use the log component (which you can do from Studio) then the URI should be something like 
&lt;BR /&gt;log:myLogger 
&lt;BR /&gt;If you use log EIP with Java DSL it would be 
&lt;BR /&gt;from(...).log(LoggingLevel.INFO,"myLogger","Some message");</description>
      <pubDate>Wed, 13 Jun 2012 11:42:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284208#M57954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-13T11:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284209#M57955</link>
      <description>Thanks Ed! This is exacly what I was looking for and works as expected. &lt;BR /&gt;Do you know what I would need to do to get the same kind of logging working from a Bean?  I found a few different log4j examples but it seems that camel doesn't like that and throws this error: An Exception Occurred...org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange</description>
      <pubDate>Wed, 13 Jun 2012 17:20:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284209#M57955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-13T17:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284210#M57956</link>
      <description>bump</description>
      <pubDate>Fri, 15 Jun 2012 16:20:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284210#M57956</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-15T16:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284211#M57957</link>
      <description>Hi Dave
&lt;BR /&gt;Sorry, I assumed you would just use a standard slf4j logger from your cBean component. Can you provide a snippet of code and some more detail on the error.
&lt;BR /&gt;Ed</description>
      <pubDate>Fri, 15 Jun 2012 16:49:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284211#M57957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-15T16:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284212#M57958</link>
      <description>Hey Ed, &lt;BR /&gt;Sorry I didnt see that you responded.  We were actually trying to use log4j and not slf4j...&lt;BR /&gt;Here is an example of the code we had using Log4j, I guess we can try slf4j.  Btw...the code in the else clause worked in eclipse but did not work when run as a bean...&lt;BR /&gt;package beans;&lt;BR /&gt;import java.io.File;&lt;BR /&gt;import org.apache.camel.Header;&lt;BR /&gt;import org.apache.log4j.Logger;&lt;BR /&gt;import org.apache.log4j.PropertyConfigurator; &lt;BR /&gt;public class CheckForMarkerFile {&lt;BR /&gt;	&lt;BR /&gt;	public String CheckForMarker(&lt;BR /&gt;			@Header(value = "orginalFileFullPath") String originalFileFullPath,&lt;BR /&gt;			@Header(value = "markerFileExtension") String markerFileExtension&lt;BR /&gt;			) throws Exception &lt;BR /&gt;	{&lt;BR /&gt;	   		System.out.println("Checking for marker file " + originalFileFullPath + markerFileExtension);&lt;BR /&gt;	    	try{&lt;BR /&gt;	 &lt;BR /&gt;	    	   File aFile = new File(originalFileFullPath + markerFileExtension);&lt;BR /&gt;				if (!aFile.exists()){&lt;BR /&gt;					String result = "False - Marker File " + originalFileFullPath + markerFileExtension + " does not exist";&lt;BR /&gt;			//tried this first without specifying the config file&lt;BR /&gt;			  Logger log = Logger.getLogger("keystoneWorkflow");&lt;BR /&gt;	                  log.info(result);                  &lt;BR /&gt;					System.out.println(result);&lt;BR /&gt;					return result;&lt;BR /&gt;				}&lt;BR /&gt;				&lt;BR /&gt;	    	   else{&lt;BR /&gt;					String result = "True - Marker File " + originalFileFullPath + markerFileExtension + " exists";&lt;BR /&gt;					//tried this with specifying the log file.  This worked in eclipse but not as a bean.&lt;BR /&gt;					PropertyConfigurator.configure("C:/Talend/Talend-ESB-V5.0.2/container/etc/org.ops4j.pax.logging.cfg"); &lt;BR /&gt;			        Logger log = Logger.getLogger("keystoneWorkflow");&lt;BR /&gt;	                log.info(result);&lt;BR /&gt;					System.out.println(result);&lt;BR /&gt;					return result;&lt;BR /&gt;	    	   }&lt;BR /&gt;	 &lt;BR /&gt;	    	}catch(Exception e){&lt;BR /&gt;	    		e.printStackTrace();&lt;BR /&gt;	    		String result = "False - " + e + " - " ;&lt;BR /&gt;	    		System.out.println(result);&lt;BR /&gt;	    		return result;&lt;BR /&gt;	    	}&lt;BR /&gt;	    }&lt;BR /&gt;	&lt;BR /&gt;}</description>
      <pubDate>Tue, 19 Jun 2012 21:06:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284212#M57958</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-19T21:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284213#M57959</link>
      <description>Yes, please try the slf4j approach.  I'm not sure what will happen if you short circuit it with a direct call to the log4j api.  slf4j as the name suggests is just another (albeit better) wrapper api for different logging implementations, including log4j.  So you will still have all the power of log4j.</description>
      <pubDate>Wed, 20 Jun 2012 14:17:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284213#M57959</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-20T14:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284214#M57960</link>
      <description>See this post 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCkJZCA0" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/sl4j-or-log4j-logging/td-p/7705&lt;/A&gt; regarding issues using slf4j. I will see if I can do a quick example with a cbean for you.</description>
      <pubDate>Wed, 27 Jun 2012 18:23:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284214#M57960</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-06-27T18:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Logging to a file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284215#M57961</link>
      <description>Haven't updated this post, but I finally got it working. here is how the code looks in the bean.
&lt;BR /&gt;Thanks for the help Ed!
&lt;BR /&gt;package beans;
&lt;BR /&gt;import java.io.File;
&lt;BR /&gt;import org.apache.camel.Body;
&lt;BR /&gt;import org.apache.camel.Header;
&lt;BR /&gt;import org.apache.camel.Property;
&lt;BR /&gt;import org.slf4j.Logger; 
&lt;BR /&gt;import org.slf4j.LoggerFactory;
&lt;BR /&gt;import org.w3c.dom.Document;
&lt;BR /&gt;
&lt;BR /&gt;public class Log2 {
&lt;BR /&gt; final Logger logger = LoggerFactory.getLogger("myAppender");
&lt;BR /&gt; 
&lt;BR /&gt; public void logMessage(){
&lt;BR /&gt; 
&lt;BR /&gt; logger.info("This is logging from a Bean"); 
&lt;BR /&gt; }
&lt;BR /&gt;
&lt;BR /&gt;}</description>
      <pubDate>Wed, 11 Jul 2012 22:47:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Logging-to-a-file/m-p/2284215#M57961</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-11T22:47:07Z</dc:date>
    </item>
  </channel>
</rss>

