Spring boot with gradle and log4j2 not logs to file -
i have start working spring boot , gradle , trying use log4j2 logging. first compiling , building:
gradlew clean build
and after execute jar:
java -jar build/libs/java-apns-notifier-0.1.0.jar
after executing jar can see log in console not in file mentioned in log4j2.xml(d:/temp/logs/apns.log). in file can see logs springframework not code.
question how make simple scenario work?
want see logs appears in log file.
here source code: java apple push notification service notifier
important!
have noticed logs appears. after kill process. clarify here going on:
- run jar with:
java -jar build/libs/java-apns-notifier-0.1.0.jar
-> nothing appears in log file
- kill process in comand line.
-> log appears in log file
the log taking time appear in log file because using
immediateflush="false"
if switch true, see logs appearing immediately, might impact performance of application.
by default, bufferedio true , buffersize 8192 bytes. means logs written disk after buffer has 8192 chars.
refer https://logging.apache.org/log4j/2.x/manual/appenders.html more details.
Comments
Post a Comment