Using separate file for different class logging

Below example logging flexiblesearch class to separate file with time based trigger policy. Also we can add rollover strategy for removing old files.

log4j2.appender.FlexlogAppender.type=RollingFile log4j2.appender.FlexlogAppender.name=FlexlogAppender
log4j2.appender.FlexlogAppender.fileName=${HYBRIS_LOG_DIR}/Flexlog.log
log4j2.appender.FlexlogAppender.filePattern=${HYBRIS_LOG_DIR}/Flexlog.log-%d{yyyy-MM-dd}.log
log4j2.appender.FlexlogAppender.ImmediateFlush=true log4j2.appender.FlexlogAppender.layout.type=PatternLayout
log4j2.appender.FlexlogAppender.layout.pattern=%m%n log4j2.appender.FlexlogAppender.policies.type = Policies
log4j2.appender.FlexlogAppender.policies.time.type = TimeBasedTriggeringPolicy log4j2.appender.FlexlogAppender.policies.time.interval = 1000000
log4j2.appender.FlexlogAppender.policies.time.modulate = true log4j2.logger.flexible.name = de.hybris.platform.jalo.flexiblesearch
log4j2.logger.flexible.level = DEBUG log4j2.logger.flexible.appenderRef.stdout.ref = FlexlogAppender log4j2.logger.flexible.additivity = false

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.