java


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.

Related Links

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

Categories

HOME
compiler-construction
yii2
asp.net-core
omnet++
image-processing
mediawiki
drivers
electron
bpmn
programming-languages
razor
c#-2.0
enterprise-library-5
pheatmap
elasticsearch-hadoop
maude-system
fancybox-3
correlation
circuit
netflix
clojurescript
foselasticabundle
invantive-sql
database-replication
crystal-reports-2008
swiftlint
jquery-ajaxq
telerik-reporting
vlsi
centos6.5
selectedindexchanged
bootstrap-duallistbox
kendo-datasource
c++-amp
gsoap
lightswitch-2013
siesta-swift
typed.js
dosbox
simplexml
disassembling
web-mining
unobtrusive-validation
trim
nomethoderror
estimote
node-sass
businessworks
cubic-spline
google-datalayer
errordocument
lowpass-filter
drupal-6
windows-iot-core-10
namecoin
or-tools
pycaffe
setuptools
transmitfile
ctest
disque
skype4py
qgraphicsview
hover-over
rvest
pickadate
bluegiga
ios8-today-widget
iis-arr
browser-bugs
cakephp-3.1
microbenchmark
sankey-diagram
clipperlib
truevault
modalpopup
gwidgets
ng-animate
angularjs-ng-click
aapt
braille
monomac
html5-notifications
ccss
inbox
dataadapter
factory-method
funscript
ocx
genshi
rfc1123
sql-server-profiler
remember-me
lpeg
w3wp.exe
dentrix
gin
modelstate
ubuntu-9.04
signal-handling

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App