I am trying to run a rule by executing a script, and in the script i am trying to use the root object logger and calling the method log. Unfortunatly i can't see those logs anywhere when i run the script:
This is the 1 line script for now logger.log("teste!!!!");
this is the log4j.properties:
# Set root logger level to error log4j.rootLogger=error, Console, File
###### Console appender definition #######
# All outputs currently set to be a ConsoleAppender. log4j.appender.Console=org.apache.log4j.ConsoleAppender log4j.appender.Console.layout=org.apache.log4j.PatternLayout
# use log4j NDC to replace %x with tenant domain / username log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n #log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
# Commented-in loggers will be exposed as JMX MBeans (refer to org.alfresco.repo.admin.Log4JHierarchyInit) # Hence, generally useful loggers should be listed with at least ERROR level to allow simple runtime # control of the level via a suitable JMX Console. Also, any other loggers can be added transiently via # Log4j addLoggerMBean as long as the logger exists and has been loaded.
# Spring log4j.logger.org.springframework=warn # Turn off Spring remoting warnings that should really be info or debug. log4j.logger.org.springframework.remoting.support=error log4j.logger.org.springframework.util=error
# Forms debugging # log4j.logger.org.alfresco.web.forms=debug # log4j.logger.org.chiba.xml.xforms=debug log4j.logger.org.alfresco.web.forms.xforms.XFormsBean=error log4j.logger.org.alfresco.web.forms.XSLTRenderingEngine=error
# Property sheet and modelling debugging # change to error to hide the warnings about missing properties and associations log4j.logger.alfresco.missingProperties=warn log4j.logger.org.alfresco.web.ui.repo.component.property.UIChildAssociation=warn log4j.logger.org.alfresco.web.ui.repo.component.property.UIAssociation=warn #log4j.logger.org.alfresco.web.ui.repo.component.property=debug
# JBPM # Note: non-fatal errors (eg. logged during job execution) should be handled by Alfresco's retrying transaction handler log4j.logger.org.jbpm.graph.def.GraphElement=fatal
#log4j.logger.org.alfresco.repo.googledocs=debug
###### Scripting #######
# Web Framework log4j.logger.org.springframework.extensions.webscripts=info log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=warn log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off
# Freemarker # Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler log4j.logger.freemarker.runtime=
# Reduces PDFont error level due to ALF-7105 log4j.logger.org.apache.pdfbox.pdmodel.font.PDSimpleFont=fatal log4j.logger.org.apache.pdfbox.pdmodel.font.PDFont=fatal log4j.logger.org.apache.pdfbox.pdmodel.font.PDCIDFont=fatal
# no index support log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexIndexer=fatal log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexSearchService=fatal
The log is supposed to appear in the browser's console right? IF not where? or what am i missing?
I have checked your logg4j.properties file and you have set log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug,It seems nothing is wrong with you log4j settings. Make sure you place log4j.properties file in the root of the class path and your js file is being called.