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 to alphabetize strings in Java using functions
ByteBuddy: Pass field of object to method
Errors when applying the layout to an android app in Android Studio. Coded with Processing
Adjusting textfield size in grid
jar runs on Windows but doesn't on Ubuntu
How to show a HashMap as empty {} instead of null
Print only 10 outputs per line
Action listener, to change images on click.
Why does my new input into an array keep getting overwritten? [duplicate]
Is it possible to reload the same FXML/Controller instance?
Dynamic form generation in jenkins plugins
Why Eclipse duplicate folders and files?
Saving an object with eager loaded parameters and OptimisticLockException
Androind Lint / Exporting code inspection in HTML returns java.lang.NullPointerException
Too many mq connections for a server connection channel which are not created by queue
InputStream of socket not closing on peer loss

Categories

HOME
bluetooth
fluentd
tizen
plone
tesseract
relay
cplex
spagobi
rubygems
survey
ezpublish
enterprise-library-5
acquia
in-app-purchase
append
primary-key
numeral.js
clearcase-ucm
dosgi
swiftlint
visjs
riot.js
rundeck
android-widget
ejabberd-module
lightswitch-2013
preg-match
karaf
cloud-code
mapbox-gl
overriding
bower-install
devextreme
libvpx
starteam
code-search-engine
webdriver-manager
lumberjack
http-live-streaming
nand2tetris
acoustics
wptoolkit
babel-core
jedis
svmlight
carrot
csound
tactic
sqlclient
ifs
ado.net-entity-data-model
intrusion-detection
make-install
packagist
bluemix-app-scan
suffix-tree
php-parse-error
design-by-contract
ios4
goose
ptrace
ora-00900
sdhc
endeca-workbench
marching-cubes
tableau-online
interrupted-exception
method-parameters
fluid-dynamics
gui-test-framework
document-classification
monomac
xsockets.net
spring-io
rabl
ember-app-kit
type-equivalence
mhtml
nsmanagedobject
postgresql-performance
removeclass
external-accessory
floating
subviews
blitz++
coda-slider
gamma
webkit.net
ti-dsp
gacutil
putchar
dbisam
ugc

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