05-26-2017 01:04 PM
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?
05-28-2017 09:32 AM
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
05-28-2017 11:30 AM
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.
Explore our Alfresco products with the links below. Use labels to filter content by product module.