<?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 Logging to xml file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355330#M121102</link>
    <description>Hi&lt;BR /&gt;I have two questions about tLogCatcher and tAdvancedOutputFileXML. I'm using TOS 3.1 in a java project.&lt;BR /&gt;1)&lt;BR /&gt;I'm trying to write into a xml file the logs from a tLogCatcher outputs.&lt;BR /&gt;The test job consist in three tWarn, a tLogCatcher plugged to a tReplicate which outputs the logs to a tLogRow, a tFileOutputDelimited and finally to  a tAdvancedFileOutputXML.&lt;BR /&gt;At the standard output and the csv output i get all of the logs messages but only the last log row is written in the xml output file although a loop element is defined.&lt;BR /&gt;See the attached screeenshots&lt;BR /&gt;I also tried to set the "append the source xml file" option but this result in a NullPointerException:&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt;	at tdsconfiggen.test_0_1.test.tLogCatcher_1Process(test.java:2851)&lt;BR /&gt;	at tdsconfiggen.test_0_1.test.tWarn_1Process(test.java:260)&lt;BR /&gt;	at tdsconfiggen.test_0_1.test.runJobInTOS(test.java:3072)&lt;BR /&gt;	at tdsconfiggen.test_0_1.test.main(test.java:2989)&lt;BR /&gt;The corresponding instruction is:&lt;BR /&gt;  // build loop xml tree&lt;BR /&gt;  org.dom4j.Element loop_tAFOX_1 = subTreeRootParent_tAFOX_1&lt;BR /&gt;      .addElement("log");&lt;BR /&gt;Does someone already met these ?&lt;BR /&gt;2)&lt;BR /&gt;Is there any way to force the tLogCatcher subjob to start after another component ?&lt;BR /&gt;Concretely i would like to set the xml output logfile path with a context variable initialized after the job has started (with a tContextLoad)&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Jonathan</description>
    <pubDate>Sat, 16 Nov 2024 13:41:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T13:41:53Z</dc:date>
    <item>
      <title>Logging to xml file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355330#M121102</link>
      <description>Hi&lt;BR /&gt;I have two questions about tLogCatcher and tAdvancedOutputFileXML. I'm using TOS 3.1 in a java project.&lt;BR /&gt;1)&lt;BR /&gt;I'm trying to write into a xml file the logs from a tLogCatcher outputs.&lt;BR /&gt;The test job consist in three tWarn, a tLogCatcher plugged to a tReplicate which outputs the logs to a tLogRow, a tFileOutputDelimited and finally to  a tAdvancedFileOutputXML.&lt;BR /&gt;At the standard output and the csv output i get all of the logs messages but only the last log row is written in the xml output file although a loop element is defined.&lt;BR /&gt;See the attached screeenshots&lt;BR /&gt;I also tried to set the "append the source xml file" option but this result in a NullPointerException:&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt;	at tdsconfiggen.test_0_1.test.tLogCatcher_1Process(test.java:2851)&lt;BR /&gt;	at tdsconfiggen.test_0_1.test.tWarn_1Process(test.java:260)&lt;BR /&gt;	at tdsconfiggen.test_0_1.test.runJobInTOS(test.java:3072)&lt;BR /&gt;	at tdsconfiggen.test_0_1.test.main(test.java:2989)&lt;BR /&gt;The corresponding instruction is:&lt;BR /&gt;  // build loop xml tree&lt;BR /&gt;  org.dom4j.Element loop_tAFOX_1 = subTreeRootParent_tAFOX_1&lt;BR /&gt;      .addElement("log");&lt;BR /&gt;Does someone already met these ?&lt;BR /&gt;2)&lt;BR /&gt;Is there any way to force the tLogCatcher subjob to start after another component ?&lt;BR /&gt;Concretely i would like to set the xml output logfile path with a context variable initialized after the job has started (with a tContextLoad)&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Jonathan</description>
      <pubDate>Sat, 16 Nov 2024 13:41:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355330#M121102</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Logging to xml file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355331#M121103</link>
      <description>Hello guy
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;I also tried to set the "append the source xml file" option but this result in a NullPointerException:&lt;BR /&gt;java.lang.NullPointerException&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Using 'append source xml file' feature, you must set a group element.
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;2)&lt;BR /&gt;Is there any way to force the tLogCatcher subjob to start after another component ?&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Yes, just like
&lt;BR /&gt;tFileInputDelimited---tConextLoad
&lt;BR /&gt; |
&lt;BR /&gt;onsubjobok
&lt;BR /&gt; |
&lt;BR /&gt;tWarn_1
&lt;BR /&gt; |
&lt;BR /&gt;onsubjobok
&lt;BR /&gt; |
&lt;BR /&gt;tWarn_2
&lt;BR /&gt;Best regards
&lt;BR /&gt; shong</description>
      <pubDate>Fri, 06 Nov 2009 06:24:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355331#M121103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-11-06T06:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Logging to xml file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355332#M121104</link>
      <description>Hi Shong 
&lt;BR /&gt;1) 
&lt;BR /&gt;Yeah that solved it, thanks ! 
&lt;BR /&gt;2) 
&lt;BR /&gt;I can effectively log my messages using tWarn at determined moment of the job, my problem is to control when the output file behind the tLogCatcher is created and its filepath determined. 
&lt;BR /&gt;My goal is to load context parameters from a file and after this, some other parameters are loaded also from a file and are used to make string substitutions which modify the previously loaded context parameters. 
&lt;BR /&gt;This works well, using context.getProperty / context.setProperty, my context is well updated. 
&lt;BR /&gt;But in facts, the logfile filepath used is the initial one which was set in the default context, so I think the tLogCatcher subjob always starts first and then the path of the logfile is set at this moment, I already tried to plug the onsubjobok trigger to the tLogCatcher and also tried to use the tPrejob component but without result. 
&lt;BR /&gt;I'll verify this behavior again 
&lt;BR /&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Jonathan</description>
      <pubDate>Fri, 06 Nov 2009 18:36:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355332#M121104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-11-06T18:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Logging to xml file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355333#M121105</link>
      <description>Hi all,
&lt;BR /&gt;I can confirm that the tLogCatcher part of the job always start first.
&lt;BR /&gt;In my case, this causes the xml logfile path to be wrong because it does not reflect the value loaded by the tContextLoad (and whatever append after the tContextLoad, here a substition of a part of this value)
&lt;BR /&gt;---
&lt;BR /&gt;I found another strange thing, when specifying just a filename as value of the tAdvancedFileOutputXML (e.g. "test.log.xml"), an exception:
&lt;BR /&gt;Exception in component tAdvancedFileOutputXML_2
&lt;BR /&gt;java.lang.StringIndexOutOfBoundsException: String index out of range: -1
&lt;BR /&gt;This correspond to the following part of code:
&lt;BR /&gt;if (fileName_tAFOX_2.substring(
&lt;BR /&gt; fileName_tAFOX_2.lastIndexOf("/")).lastIndexOf(".") &amp;gt; 0) {
&lt;BR /&gt; file_tAFOX_2 = fileName_tAFOX_2.substring(0,
&lt;BR /&gt; fileName_tAFOX_2.lastIndexOf("."));
&lt;BR /&gt;} else {
&lt;BR /&gt; file_tAFOX_2 = fileName_tAFOX_2;
&lt;BR /&gt;}
&lt;BR /&gt;java.io.File createFiletAFOX_2 = new java.io.File(
&lt;BR /&gt; fileName_tAFOX_2);
&lt;BR /&gt;This is due to lastIndexOf("/") call inside the substring call (not very nice !)
&lt;BR /&gt;I think having such a filename is a valid use case so this may be a bug ...</description>
      <pubDate>Wed, 02 Dec 2009 17:54:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355333#M121105</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-02T17:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Logging to xml file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355334#M121106</link>
      <description>Hello 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;I think having such a filename is a valid use case so this may be a bug ...&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Here you must specify one file path, not file name. There is a button for browsing a file path, so there is alway one '/' at least in the file path. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Thu, 03 Dec 2009 03:25:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355334#M121106</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-03T03:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Logging to xml file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355335#M121107</link>
      <description>Hi Shong,
&lt;BR /&gt;You're right, this must be the way to do and if the need is to put the file in the current execution directory this may be done by adding a "./" prefix to the file path.
&lt;BR /&gt;Concerning the start time of tLogCatcher chain, do you know any way to control this ?
&lt;BR /&gt;Best regards</description>
      <pubDate>Thu, 03 Dec 2009 08:38:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Logging-to-xml-file/m-p/2355335#M121107</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-03T08:38:06Z</dc:date>
    </item>
  </channel>
</rss>

