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:

  1. run jar with:

java -jar build/libs/java-apns-notifier-0.1.0.jar

-> nothing appears in log file

  1. 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

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -