Adding logs for campaign-related actions
You can add Loggers to the log4j2.xml
configuration file to define which data is logged and how much detail is provided.
Appenders allow you to specify where the output is directed.
The log4j2.xml
file is located in your Tomcat installation here: /apache-tomcat/webapps/magnoliaAuthor/WEB-INF/config/default/log4j2.xml
. Follow the steps below to configure the logs for campaign-related actions.
-
Add the Logger entry below.
Logger... <Logger name="info.magnolia.campaignpublisher" level="INFO" additivity="true"> <AppenderRef ref="log-campaigns"/> </Logger> ...
-
Add the following appenders to your configuration file to specify
magnolia-campaigns.log
as the output filename in the Magnolia logs folder of your installation.Appenders... <RollingFile name="sync-log-campaigns" fileName="${magnolia.logs.dir}/magnolia-campaigns.log" filePattern="${magnolia.logs.dir}/magnolia-campaigns-%i.log" append="true"> <PatternLayout pattern="%-5p %c %d{dd.MM.yyyy HH:mm:ss} -- %encode{%m}{CRLF}%n"/> <ThresholdFilter level="INFO"/> <Policies> <SizeBasedTriggeringPolicy size="1MB"/> </Policies> <DefaultRolloverStrategy max="5"/> </RollingFile> <Async name="log-campaigns"> <AppenderRef ref="sync-log-campaigns"/> </Async> ...