Introduction Here in this example, I am going to show you how to create Spring Boot profile based logging. For any applications logging is an important things which will help you to debug through your application errors or issues and you can fix them easily by analyzing those errors or issues from the log files….

Posted in Log4J Spring Boot

Spring Boot Profile Based Logging

Introduction The ELK Stack is made of three open-source products: 1) Elasticsearch, 2) Logstash, and 3) Kibana. Elasticsearch: It is a NoSQL database which is based on the open-source search engine called Lucene. So Elasticsearch is a search and analytics engine. Logstash: It is a data processing pipeline tool which accepts inputs from (multiple) sources,…

Posted in Log4J Spring Boot

ELK Stack Integration with Spring Boot Applications

Introduction In this example we will see how to create or generate separate log file module-wise or for each separate functionality using RoutingAppender in log4j2 with the help of ThreadedContext or MDC. MDC or Mapped Diagnostic Context is a lighter technique consists of uniquely stamping each log request servicing a given client. To uniquely stamp…

Posted in Java Log4J

How to create separate log file for each module using RoutingAppender and MDC (Mapped Diagnostic Context) in log4j2/slf4j

Introduction In this tutorial I will show you how to configure log4j2 in Java, Spring and Spring Boot applications. The same log4j2 configuration will work for Java, Spring and Spring Boot applications. I am not going to show you how to use logback API in Spring Boot application, instead I will exclude logback API from…

Posted in Java Log4J Spring Spring Boot

How to configure log4j2 in Java, Spring and Spring Boot Applications

Log4j is a logging library for Java applications and the purpose of inserting log statements into the code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is often the case for distributed applications.

Posted in Log4J

Logging Best Practices using Log4j

Introduction The purpose of inserting log statements into the code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is often the case for distributed applications. Features of Log4j We can enable logging at runtime without modifying the application binary. We…

Posted in Log4J

Log4j Configurations – Controlling Logging to Multiple Files

Introduction We will see here an example on simple log4j configuration in Java. The purpose of inserting log statements into the code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is often the case for distributed applications.

Posted in Java Log4J

Simple Log4j Configuration in Java