logger.log is not logging to alfresco.log

半世苍凉 提交于 2019-12-04 07:21:28

Looks like you got confused with what applies to the repository and what applies to share.

In the repository:

logger.log uses the category org.alfresco.repo.jscript.ScriptLogger at level debug, so what you have in custom-log4j.properties is correct (the appender is ignored though). Make sure it is in the classpath at alfresco/extension. The directory tomcat/shared/classes/alfresco/extension is what you usually want.

In share:

logger.log uses the category org.springframework.extensions.webscripts.ScriptLogger. As far as I remember, there is no "custom-log4j property configuration mechanism" available there, so you'll have to append

log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=debug

to share/WEB-INF/classes/log4j.properties.

If you don't want to restart alfresco and execute your script in repository, there is another way as work-around solution. Try to use logger.system.out other than logger.log and you will still find the logging message in catalina.out.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!