If one is not running inside a web application, what is the proper way to shutdown Log4j2? I only see a noop LogManager.shutdown()
Log4j-Web library is the preferred way to properly clean-up resources in Web-application.
To enable it, add such a dependency to your pom.xml
org.apache.logging.log4j
log4j-web
${log4j2.version}
runtime
It will work 'out-of-the box' in Servlet 3.* environment. If you're using older Servlet specification, details how to enable proper cleaning for log4j2 are available here: https://logging.apache.org/log4j/2.x/manual/webapp.html