Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application name is missing in Spring Boot logs

For example, people usually get something like this (my-service-id is the application name)

2016-02-11 17:12:45.404  INFO [my-service-id] 85184 --- [nio-8080-exec-1] com.example.MySimpleComponentMakingARequest     : ...

But I get something like

2016-02-11 17:12:45.404  INFO 85184 --- [nio-8080-exec-1] com.example.MySimpleComponentMakingARequest     : ...

What am I doing wrong ?

like image 851
Varshini Avatar asked Sep 14 '25 14:09

Varshini


1 Answers

One option is to configure that via application.properties

application.properties

spring.application.name=stackoverflow
logging.pattern.level= %5p [${spring.application.name}] 

If want to use the project info defined in your pom.xml you could do something like:

[email protected]@ @project.version@

Full documentation can be found here: logging features

like image 198
Dirk Deyne Avatar answered Sep 16 '25 06:09

Dirk Deyne