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

Pig UDF Test cases: org.apache.pig.test.MiniGenericCluster cannot resolve
Using POI for excel works in Java
ActiveMQ keeps ESTABLISHED connections
Java ArrayList<ArrayList<String>> clear() on child clears parent
Force read only first sheet in Apache POI
Get info about which groups didn't matched
IBM Watson Conversation API returning parent node always, not inserting into child node
HttpClient vs HtmlUnit
The method getOrDefault(String, String) is undefined for the type Map<String,String>
Voice recognition/dictation for Android [closed]
import(as library) zip file in library
Unable to find message body reader with content type application/json in Jersey Test Framework
C# byteArray to Java
why is java taking long time initializing two dimensional arrays starting with the first dimension having a big size number?
Why does this Query return NULL?
How to compare password with the password which is encrypted and stored in DB, when user enters for login

Categories

HOME
asp.net-core
gerrit
netbeans
urbancode
reflection
isabelle
gremlin
single-sign-on
angular-material
infragistics
amazon-ecs
frameworks
cross-browser
podio
append
esper
gnupg
communication
qt-creator
google-cloud-spanner
moonmail
visual-studio-cordova
msp430
quartz-scheduler
graphlab
google-static-maps
http-status-code-504
interop
sms-gateway
immutable.js
java-3d
abi
dxf
fish
wpfdatagrid
greendao
linkerd
social-media
gsoap
instant-messaging
javascriptcore
binary-data
catch-all
openoffice.org
atl
bitbucket-pipelines
serve
lto
unspecified
preconditions
avro4s
unixodbc
angular2-meteor
angular-resource
apache-fop
strptime
integrity
idisposable
tropo
colorama
composite-key
nsarray
arrow-keys
nbconvert
dwscript
watchconnectivity
time-and-attendance
heidisql
httplistener
trash
asp.net-4.5
fputcsv
markojs
r-tree
google-places
thredds
spidermonkey
computer-algebra-systems
microbenchmark
census
p2
sonarqube5.1.2
inmobi
c++03
fscommand
rake-task
tween
dd
knuth
android-imagebutton
wordpress-theme-customize
client-side-templating
html-helper
ceil
aapt
expected-exception
htmlcleaner
didselectrowatindexpath
intentservice
prettify
multiprocessor
c18
geos
ril
android-hardware
path-separator
unc
cisco-jtapi
dbproviderfactories
enter
php-parser
deobfuscation
django-tagging
invite
xtype
rfc1123
yslow
ncqrs
nintendo-ds
memory-size
data-driven
procedural-music
zune

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