spring-boot-log4j-2-scaffolding

keep growing logo

This project is a simple scaffolding for a Spring Boot application that uses Log4j 2 for logging and Elastic Stack for processing log entries.

To learn how to set up a project like this one, check out the following posts:

Getting Started

To clone the repository, run in the command line:

$ git clone https://github.com/little-pinecone/spring-boot-log4j-2-scaffolding.git

You can build the application with:

$ mvn clean install

Spring security

The application uses Spring Boot security starter. The default credentials are specified in the application.properties file:

Monitoring Spring Boot with Actuator

After starting the Spring Boot app, you have to sign in:

login form

Now you can browse the enabled and exposed Actuator endpoints: info, health, metrics.

Run the Spring Boot app, Elastic Stack, Prometheus and Grafana

IMAGE                                     PORTS                                            NAMES
elasticsearch:7.7.0                  0.0.0.0:9200->9200/tcp, 9300/tcp                 springbootelasticstack_elasticsearch_1
logstash:7.7.0                       0.0.0.0:5044->5044/tcp, 0.0.0.0:9600->9600/tcp   springbootelasticstack_logstash_1
kibana:7.7.0                         0.0.0.0:5601->5601/tcp                           springbootelasticstack_kibana_1
springbootelasticstack_filebeat                                                       springbootelasticstack_filebeat_1
springbootelasticstack_metricbeat                                                     springbootelasticstack_metricbeat_1
elastichq/elasticsearch-hq:latest    0.0.0.0:5000->5000/tcp                           springbootelasticstack_elastichq_1
prom/prometheus                      0.0.0.0:9090->9090/tcp                           springbootelasticstack_prometheus_1
grafana/grafana:7.1.3                0.0.0.0:3000->3000/tcp                           springbootelasticstack_grafana_1
springbootelasticstack_app           0.0.0.0:8080->8080/tcp                           springbootelasticstack_app_1

elastichq-screenshot

kibana-login-screenshot

kibana-discover-screenshot

stack-monitoring-screenshot

Standalone cluster shows metrics for Filebeat, docker-cluster displays metrics for Elasticsearch, Kibana and Logstash:

docker-cluster-screenshot

You can also monitor the application state using Grafana:

grafana-dashboard-screenshot

Overview and technical features

Built With

License

This project is licensed under the Unlicense - see the license details.