04-19-2017 09:28 AM
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 success
As for the log I tested with start-pooled-review-workflow.js but I can't find the logger messages
Thanks
Jamil
04-19-2017 11:33 AM
As a workaround: If you use
logger.system.out("Your message");
you can see your message in tomcat/logs/catalina.out
Or you would have to configure your log4j properties, or use Florian Mauls javascript console add-on GitHub - share-extras/js-console: Administration Console component for Alfresco Share, that enables ...
04-19-2017 11:33 AM
As a workaround: If you use
logger.system.out("Your message");
you can see your message in tomcat/logs/catalina.out
Or you would have to configure your log4j properties, or use Florian Mauls javascript console add-on GitHub - share-extras/js-console: Administration Console component for Alfresco Share, that enables ...
04-20-2017 03:58 AM
For the workaround, do I need to enable any log properties or alfresco client-debug?
04-20-2017 05:07 AM
Yes, client-debug must be enabled. I just tested it
Thank you Martin
04-20-2017 05:10 AM
...didn't know that - Thank you Jamil
04-20-2017 05:08 AM
should work out of the box. The message shows up in catalina.out without any timestamp or so.
So, for debugging, I use a logging function:
function logMe(message) {
var d = new Date(); //timestamp
var ds = utils.toISO8601(d) + ""; //use add "" to make sure it's a string
logger.system.out(ds.replace("T", " ").trim() + " " + script.name + ": " + message);
}
Code is extremely explicit for better understanding
script.name is only defined for scripts (rules etc...) not for web scripts.
04-20-2017 06:38 AM
Okay, I was looking inside alfrescotomcat-stdout.log and not the catalina.out because my alfresco instance is working as a service.
So:
logger.system.out is writing in "alfrescotomcat-stdout.log" if alfresco client-debug is enabled
logger.system.out is writing in "catalina.out" out of the box
Too helpful because now I can debug my repository javascript Rules without even restart the server
Jamil
Explore our Alfresco products with the links below. Use labels to filter content by product module.