How can I avoid Spring Boot Logback's fail-fast on file creation?
While starting up, Logback attempts to create/open the logging files. However, on current Spring Boot's implementation, if the files cannot be opened the application is shut down. This seems to be an intentional behavior, as seen on SpringBoot's git. What I would prefer is either to default to Tomcat's log, or to disable log altogether, but allowing my application to keep running. As we need to deploy it on various environments and for a short lifespan, I would rather not have to customize the log path on every instance to be deployed. Still, I have not found any property on Spring Boot nor Logback setups which may allow me to do this. Is there any way to bypass the IllegalStateException? This is the error thrown on startup: java.lang.IllegalStateException: Logback configuration error detected: ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE-MESSAGES-BODIES] - Failed to create parent directories for [C:\MY_PATH\file.log] ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE-MESSAGES-BODIES] - openFile(C:\MY_PATH\file.log,true) call failed. java.io.FileNotFoundException: C:\MY_PATH\file.log (The device is not ready) ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE-LOG] - Failed to create parent directories for [C:\MY_PATH\file.log] Using Spring Boot (v1.5.3)
As mentioned in the documentation you can configure the org.springframework.boot.logging.LoggingSystem system property with a value of none to disable Spring Boot's logging system. You can then use logback.xml as you usually would to configure logging, or omit it to use Logback's default configuration.
How do I build a metawriter bean for Alfresco?
Finding location in android using Gabe Sechan's tutorial
Binary presentation of negative integer in Java
Using Callable in Spring controller with WebApplicationInitializer getting IllegalStateException
ImportError: No module named py4j.java_gateway
How to display selected columns of database in a Jtable?
How to amend LDAP connection properties in LDAPCertStore for X509 cert chain validation
In JAVA Finding File by name(any extension) from all drive of computer
Access to private field of a super class
Printing a simple double number in java [duplicate]
How to call PostgreSQL stored procedures with JDBC
Should all members shared between WebSocket sessions be synchronized?
How to specify the same Type of class for a returned value in an interface method?
Get parent-child relationship between tables through application
Eclipse:How to Detect a Project is Part of the Workspace
Spring MVC uri mapping with percent encoded characters