If I use logger.log or logger.debug in server side javascript
like
logger.log("Hello");
Will "Hello" get printed in console or some log file?
It depends on the Log4J configuration. By default logger.log will not print to the console / alfresco.log / share.log unless you change the log level threshold via the custom-log4j.properties (Repository-tier only) or by modifying the default log4j.properties (unfortunately the only way for Share-tier). The setting you need to add for logger.log to output anything is
log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=debug
since logger.log translates to "debug" level of logging
Hi:
As additional comment to Axel's one, you can use logger.warn() to print your logs in catalina.out and alfresco.log with default Alfresco configuration. You can check it easily with Javascript Console.
Regards.
--C.
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.