<div dir="ltr">Hi,<div><br></div><div>Short version: If the creation of the appender fails (permission denied), how do I explicitly re-attempt to create it when the problems with the permissions are resolved. I am using XML configuration. I would like to do this without re-starting my process.</div><div><br></div><div>Longer version:</div><div><br></div><div>I am using Logback on Android (logback-android).</div><div><br></div><div>I am logging to a directory on the external storage, which means that if the user connects the device to the PC and enables mass-storage, the file system of the directory will be unmounted.</div><div><br></div><div>If the application is started, while the directory is not available, I inform the user but since the loggers are defined as static fields ...</div><div><br></div><div>private static final Logger LOG = LoggerFactory.getLogger(MyApplication.class);</div><div><br></div><div>... logback attempts to create the appender anyway and fails.</div><div><br></div><div>Because of how Android works, the application process continues running even when the user leaves all screens of my application (for example goes to the home screen) and so the appender will never be re-attempted to be created.</div><div><br></div><div>Is there some way to reset the appender from the config? If so, I could attempt to reset logback if necessary whenever the user enters the initial screen of my application.</div><div><br></div><div>I tried to stop it using ...</div><div><br></div>LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();<br>if (loggerContext != null)<br>loggerContext.stop();<div><br></div><div>... which seems to work fine but I don't seem to be able to re-start it:</div><div><br></div><div>loggerContext.start()<br></div><div><br></div><div>This does not seem to re-create the appender.</div><div><br></div><div>Many thanks in advance for help.</div><div><br></div><div>Martin</div><div><br></div></div>