As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
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.