Log4j2 is the updated version of the popular and influential log4j library, used extensively throughout the Java ecosystem for so many years. Version 2.x keeps all the logging feat… Read More
Logging plays a critical role in every application. In this tutorial, we’ll explore how to use Apache Log4j 2.x and highlight best practices that can help you in getting started and im… Read More
Debugging MySQL Errors in Java: Tips and Tricks
MySQL is one of the most popular relational database management systems used by developers worldwide. It is open-source and provides a wide ra… Read More
Debugging is an essential part of software development. It is the process of finding and fixing errors, bugs, and other issues in software. Debugging can be a time-consuming and frustrating… Read More
We can
define an immutable configuration by defining a class and use the
@ConfigurationInject annotation on a constructor of a @ConfigurationProperties
or @EachProperty bean.
Exampl… Read More
Java servlets are an essential part of any modern web application. They are responsible for handling HTTP requests and generating responses. However, debugging servlets can be a challenging… Read More
ChatGPT is an AI language model developed by OpenAI, capable of generating human-like text based on input. The model is trained on a large corpus of text data and can generate response… Read More
If you know about these 5 keywords try, catch, finally, throw and throws and how to use them, you pretty much know what Java exception handling is all about. But there are also some best pr… Read More
In the post Serialization in Java it has already been discussed that serialization is the mechanism by which any object can be converted to byte stream. By default all of the object vari… Read More
☞Refer Core Java basics interview questions for a comprehensive list of Core Java Interview Questions.What is encapsulation? Encapsulation means keeping together the implementatio… Read More
A middleware is a type of function which can be used to intercept the application's request-response mechanism and has access to the request object, response object and the next function. Ne… Read More
(Read this article on the blog)
Last updated on 2022/04/26 to include changes up to JDK 18.
This article is also available in Chinese by Alex Tan.
Since the release of version 8, up to ver… Read More
There are two possible solutions here. Solution 1: By specifying the environment property 'logging.config', we can provide the custom location of log4j2 file. Examplejava -Dlog… Read More
Using -Dproperty=value syntax, we can set a system property value. If the value is a string that contains spaces, you must enclose the string in double-quotes.SystemPropertiesDemo1.javapubli… Read More
'slf4j-ext' module provides extensions (like profiling, Extended logging, Event logging) to the core slf4j API. In this post, I am going to explain how can we measure application perf… Read More
Last updated on 2021/04/01 to include changes up to JDK 16.
Since the release of version 8, up to version 16, Java is shaped by 180
JDK Enhancement Proposals (JEPs), each of which brings so… Read More