Hi,
I have below setting in my AMP's log4j.properties file. The below setting works fine and creates a separate log file named amp_abc.log. The only problem is the AMP specific log goes to both the files alfresco.log and amp_abc.log file.
Is there any way so that the logs goes only to the AMP specific log file and not in alfresco.log too.
log4j.appender.moduleLog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.moduleLog.File=amp_abc.log
log4j.appender.moduleLog.layout=org.apache.log4j.PatternLayout
log4j.appender.moduleLog.layout.ConversionPattern=%d{yyyy-MM-dd} %d{ABSOLUTE} %-5p [%c] [%t] %m%n
log4j.logger.com.abc.component=debug,moduleLog
Solved! Go to Solution.
You have to configure the "additivity" of your logger to false to no longer make it propagate logging events to inherited appenders (the alfresco.log is an appender inherited from the root).
You have to configure the "additivity" of your logger to false to no longer make it propagate logging events to inherited appenders (the alfresco.log is an appender inherited from the root).
Thanks for your reply Axel Faust
I tried the below line in my AMP log4j.properties file but it is still putting logs in parent log file.
log4j.additivity.moduleLog=false
You do not define the additivity for the appender, you have to define it for the logger package.
log4j.additivity.com.abc.component=false
Then, every logger in the com.abc.component package will only log to the appender you specified (moduleLog) and not propagate further up...
Great! That worked!
Thanks for your time and help...!
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.