<?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: How to debug/log a rule script in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8338#M3785</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;should&amp;nbsp;work out of the box. The message shows up in catalina.out without any timestamp or so.&lt;/P&gt;&lt;P&gt;So, for debugging, I use a logging function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;logMe&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; d &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Date&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//timestamp&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; ds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; utils&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toISO8601&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;d&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//use add "" to make sure it's a string&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; logger&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;system&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;out&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ds&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;replace&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"T"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;trim&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; script&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;": "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code is extremely explicit for better understanding&amp;nbsp;&lt;/P&gt;&lt;P&gt;script.name is only defined for scripts (rules etc...) not for web scripts.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Apr 2017 09:08:02 GMT</pubDate>
    <dc:creator>mehe</dc:creator>
    <dc:date>2017-04-20T09:08:02Z</dc:date>
    <item>
      <title>How to debug/log a rule script</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8334#M3781</link>
      <description>Hello,Can you please write a step by step how to debug a Rule repo javascript?I activated the debug console and changed the needed into the alfresco log4j without successAs for the log I tested with&amp;nbsp;start-pooled-review-workflow.js but I&amp;nbsp;can't find the logger messagesThanksJamil&amp;nbsp;</description>
      <pubDate>Wed, 19 Apr 2017 13:28:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8334#M3781</guid>
      <dc:creator>jamilnour</dc:creator>
      <dc:date>2017-04-19T13:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug/log a rule script</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8335#M3782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As a workaround: If you use&lt;/P&gt;&lt;P&gt;logger.system.out("Your message");&lt;/P&gt;&lt;P&gt;you can see your message in tomcat/logs/catalina.out&lt;/P&gt;&lt;P&gt;Or you would have to configure your log4j properties, or use Florian Mauls javascript console add-on&amp;nbsp;&lt;A class="link-titled" href="https://github.com/share-extras/js-console" title="https://github.com/share-extras/js-console" rel="nofollow noopener noreferrer"&gt;GitHub - share-extras/js-console: Administration Console component for Alfresco Share, that enables the execution of arb…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Apr 2017 15:33:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8335#M3782</guid>
      <dc:creator>mehe</dc:creator>
      <dc:date>2017-04-19T15:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug/log a rule script</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8336#M3783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the workaround, do I need to enable any log properties or alfresco client-debug?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 07:58:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8336#M3783</guid>
      <dc:creator>jamilnour</dc:creator>
      <dc:date>2017-04-20T07:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug/log a rule script</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8337#M3784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, client-debug must be enabled. I just tested it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 09:07:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8337#M3784</guid>
      <dc:creator>jamilnour</dc:creator>
      <dc:date>2017-04-20T09:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug/log a rule script</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8338#M3785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;should&amp;nbsp;work out of the box. The message shows up in catalina.out without any timestamp or so.&lt;/P&gt;&lt;P&gt;So, for debugging, I use a logging function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;logMe&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; d &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Date&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//timestamp&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; ds &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; utils&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toISO8601&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;d&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//use add "" to make sure it's a string&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; logger&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;system&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;out&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ds&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;replace&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"T"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;trim&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; script&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;": "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; message&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code is extremely explicit for better understanding&amp;nbsp;&lt;/P&gt;&lt;P&gt;script.name is only defined for scripts (rules etc...) not for web scripts.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 09:08:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8338#M3785</guid>
      <dc:creator>mehe</dc:creator>
      <dc:date>2017-04-20T09:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug/log a rule script</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8339#M3786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;...didn't know that - Thank you Jamil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 09:10:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8339#M3786</guid>
      <dc:creator>mehe</dc:creator>
      <dc:date>2017-04-20T09:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to debug/log a rule script</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8340#M3787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I was looking inside alfrescotomcat-stdout.log and not the catalina.out because my alfresco instance is working as a service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So:&lt;/P&gt;&lt;P&gt;logger.system.out is writing in "&lt;SPAN&gt;alfrescotomcat-stdout.log" if alfresco&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;client-debug is enabled&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d;"&gt;logger.system.out is writing in "catalina.out" out of the box&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d;"&gt;Too helpful because now I can debug my repository javascript&amp;nbsp;Rules without even restart the server&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d;"&gt;Jamil&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 10:38:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-debug-log-a-rule-script/m-p/8340#M3787</guid>
      <dc:creator>jamilnour</dc:creator>
      <dc:date>2017-04-20T10:38:21Z</dc:date>
    </item>
  </channel>
</rss>

