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
Solved! Go to Solution.
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 ...
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 ...
For the workaround, do I need to enable any log properties or alfresco client-debug?
Yes, client-debug must be enabled. I just tested it
Thank you Martin
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.
...didn't know that - Thank you Jamil
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
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.