[
https://issues.apache.org/jira/browse/LOG4J2-3454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17515444#comment-17515444
]
Ralph Goers edited comment on LOG4J2-3454 at 3/31/22, 5:08 PM:
---------------------------------------------------------------
# See the OnStartupTriggeringPolicy in the
[manual|[https://logging.apache.org/log4j/2.x/manual/appenders.html#TriggeringPolicies].]
# If at all possible don't write your own.
# See PatternSelectors in the
[manual|http://https://logging.apache.org/log4j/2.x/manual/layouts.html#Pattern_Selectors].
You can implement your own PatternSelector if one of the existing ones doesn't
meet your needs.
was (Author: [email protected]):
# See the OnStartupTriggeringPolicy in the
[manual|[https://logging.apache.org/log4j/2.x/manual/appenders.html#TriggeringPolicies].]
# If at all possible don't write your own.
# See PatternSelectors in the
[manual|[http://https://logging.apache.org/log4j/2.x/manual/layouts.html#Pattern_Selectors].|http://https//logging.apache.org/log4j/2.x/manual/layouts.html#Pattern_Selectors].]
You can implement your own PatternSelector if one of the existing ones doesn't
meet your needs.
> how to force rolling file appender to create a new log file every time when
> we start the application?
> -----------------------------------------------------------------------------------------------------
>
> Key: LOG4J2-3454
> URL: https://issues.apache.org/jira/browse/LOG4J2-3454
> Project: Log4j 2
> Issue Type: Question
> Affects Versions: 2.17.2
> Reporter: Janardhan Naidu
> Priority: Major
>
> HI Team,
>
> I am in process of migrating the log4j1 to log4j2, where we are rewriting the
> appenders with the help of AbstractAppender Plugin or using the property
> file. I have multiple questions regarding this, please help me to resolve the
> same.
> # how to force rolling file appender to create a new log file every time
> when we start the application? here, consider appenders are configured in
> property file.
> # We are rewriting one of the rollingfileappender using the
> abstractappender/abstractfileappender plugin way, But i am unable to find a
> method which will get executed before starting of the appender!. in log4j1,
> we had a method called *checkEntryConditions.* So what is the equalent api in
> log4j2.? FYI, we are overriding this method to set all our configurations
> like backup the old logfile, createnew logger, rolling etc..,
> # Also, we need to set the ConversionPattern based on the loggername, how we
> can achieve this.? in log4j1, we were extending patternLayout and overriding
> the format method to do the same. So how we can acheive this using log4j2?
>
> Thanks
> Janardhan
--
This message was sent by Atlassian Jira
(v8.20.1#820001)