java


How to set absolute logdir in spring-boot?


https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-logging.html
According to the docs above, I could set the logpath and filename as follows.
logging.file=/var/log/mylog.log.
BUT: I see the logging to console, but the logfile is never writter (nowhere on the filesystem!).
When I change the property as follows:
logging.file=var/log/mylog.log.
Then I'm getting the log in classpathroot/var/log/mylog.log.
Question: why is it working under the classpath root, but not in /var/log?
If you use relative path in the value of logging.file, it will save log in under current directory. As it is mentioned in the section.
Writes to the specified log file. Names can be an exact location or relative to the current directory.
But if you provide absolute path in the value. Then there is no problem at all. But i think in your case you had put a directory which is not permitted to write file by the user you were trying to run the application.
Better to provide a directory which having permission to write file or give the permission to the application user (which will run application) to write file in the given directory.
use logging.path=/var/log/mylog.log as indicated here
https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-logging.html section 26.3

Related Links

Is it alright to override MappingJackson2HttpMessageConverter to support HAL+JSON?
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 2 column 5
App Engine session cookie expiration
Not getting extends java.lang.Object in bytecode. so why compiler is not adding it in newer version of java?
want to check value of a particular node exists or not in Java [closed]
Why won't this code display Error: Could not find file when e is thrown by a nonexistant file?
Connection is getting closed everytime when server is down. have added timeout 10000000.
How to extract a value from a facebook invite friends onComplete() response
Validation for seaching arrayLists
How to retrieve parser context while deserializing JSON with Jackson and #JSonPOJOBuilder
JavaFX can't set WebView in FXML file
How to uncompress in java gzip file with LZMA compression
App crash when is submitting score leaderboard Google Play
How is a component event caught by a component listener
How to pass Object of Service to MyActivity?
future dates using H2 PARSEDATETIME

Categories

HOME
testing
date
openmp
cookies
dictionary
plone
umd
wamp
flyway4
indesign
pheatmap
gorm
imacros
row
modx-revolution
google-apps-marketplace
ibm-odm
decimal
windows-7-x64
nhibernate-envers
lucene.net
accessor
tapestry
excel-2007
cultureinfo
semantic-analysis
elasticsearch-ruby
wtx
windows-server-2000
junit5
ecto
create-table
commit
protovis
wallpaper
mapbox-gl
mapdb
plsql-psp
angularjs-factory
graphenedb
optix
grid.mvc
node-gyp
network-flow
zip4j
pg-dump
snmptrapd
media-player
epson
bind9
color-profile
wdf
instant
adxstudio-portals
intrusion-detection
nsfilemanager
master-slave
rvest
retina
atk4
citrus-pay
vstest.console.exe
graph-api-explorer
streambase
asp.net-dynamic-data
applescript-objc
client-side-templating
quantlib-swig
opcache
file-locking
yui-compressor
jquery-mobile-dialog
seed
venn-diagram
qt-jambi
f#-powerpack
h.323
microsoft-virtualization
procedural-music
scripting-languages
mdac
windows-live-messenger

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