You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2022/02/19 08:54:00 UTC

[jira] [Commented] (LOG4J2-3389) Log42j: Provide the capability to Rollover all appenders in an application on Shutdown

    [ https://issues.apache.org/jira/browse/LOG4J2-3389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17494922#comment-17494922 ] 

Ralph Goers commented on LOG4J2-3389:
-------------------------------------

I would imagine it would be simple to write an OnShutdownRolloverPolicy that registers itself as a shutdown listener. However, it will only be triggered on a normal shutdown. It would not be possible to rollover when the JVM or server crashes.

> Log42j: Provide the capability to Rollover all appenders in an application on Shutdown
> --------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-3389
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3389
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Appenders, Configuration
>    Affects Versions: 2.17.1
>         Environment: All, provide the feature as an implementation that can be defined in the Log4j2 Configuration
>            Reporter: Brian Antao
>            Assignee: Ralph Goers
>            Priority: Major
>              Labels: Configuration, config.xml, log4j2
>             Fix For: 2.18.0
>
>
> I have seen many issues raised in StackOverflow for different variations of findingĀ  a good solution to rolling over of all appenders in an application on Shutdown. But no clear and best solution emerges.
> Hence raising this issue which we in our organisation also haveĀ  a great and urgent Need for.
> What we need is:
> A Rollover strategy that we can include in all appenders in the Log4j2 Configuration, in the Appender definition to properly rollover the associated log files on Shutdown.
> The full rollover functionality needs to be defined fully in the Configuration only and no need for Java Code to be written to call the LogManager.Shutdown() method.
> This feature would be a tremendous boost particularly managing log files associated with multiple pods in Kubernetes deployed applications.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)