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

Gracefully stopping LogContext using the api interfaces

    Details

    • Type: Question
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta3
    • Fix Version/s: 2.6
    • Component/s: API
    • Labels:
      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

            • Assignee:
              ralph.goers@dslextreme.com Ralph Goers
              Reporter:
              bekisz Szabolcs Beki
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: