cancel
Showing results for 
Search instead for 
Did you mean: 

logger.debug

sakshik
Star Contributor
Star Contributor

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?

2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator

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

cesarista
World-Class Innovator
World-Class Innovator

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.

Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.