Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-124

Gracefully stopping LogContext using the api interfaces

    XMLWordPrintableJSON

Details

    • Question
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0-beta3
    • 2.6
    • API
    • None

    Description

      I'm trying to gracefully close my SocketAppender before exiting the my application to avoid IOExceptions on the socket server side.

      Currently I can make it only by using interface the org.apache.logging.log4j.core.Lifecycle interface in the Log4j2 core :

      ((Lifecycle) LogManager.getContext()).stop();

      I would prefer to have a cleaner solution that uses solely the Log4j-api not Log4j-core.

      Did I overlook something or stop() on the API side really missing ?

      Attachments

        Activity

          People

            rgoers Ralph Goers
            bekisz Szabolcs Beki
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: