Author name: javaplanet.io

Introduction to Design patterns

Design patterns are reusable solutions to common software design problems, providing a structured approach to building robust, maintainable, and scalable systems. They capture best practices and proven techniques, allowing developers to solve recurring issues efficiently without reinventing the wheel. Originating from the work of Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (the “Gang …

Introduction to Design patterns Read More »

Basics of Handlers

In the java.util.logging package, Handlers are components that take LogRecord objects from a Logger and publish them to a specific destination (console, file, socket, etc.). Commonly Used Handlers Commonly Used Methods Simple Program: Using ConsoleHandler Output: A Handler decides where the logs go: console, file, remote socket, etc.You can attach multiple Handlers to a single …

Basics of Handlers Read More »

Exploring java.util.logging package

The java.util.logging package is Java’s built-in logging API that enables developers to capture runtime information, errors, and system status messages efficiently. Introduced in Java 1.4, it provides a standard mechanism for logging messages from Java applications. Why Use java.util.loggong? The main benefit of java.util.logging is that it is part of the Java standard library. It …

Exploring java.util.logging package Read More »

SLF4J

SLF4J (Simple Logging Facade for Java) is a Java API designed to serve as a simple facade or abstraction for various logging frameworks such as: Log4j Logback java.util.logging (JUL) Apache Commons Logging It allows developers to plug in the desired logging framework at deployment time without modifying the source code. Why Use SLF4J? Decoupling: Your …

SLF4J Read More »

Log4j

Log4j (short for Logging for Java) is a reliable, fast, and flexible logging framework developed by the Apache Software Foundation. It allows developers to log messages according to different severity levels and send those messages to multiple destinations like the console, files, GUI components, databases, or remote servers. Evolution: Log4j 1.x: Original version, now deprecated. …

Log4j Read More »

Creating loggers

Custom loggers allow you to define named loggers tailored to specific application modules, services, or classes. This modular approach helps in maintaining granular control over logging configuration, enabling separate log levels, handlers, and formatters for different components. Simple Program This shows how a custom-named logger (MyCustomLogger) is configured independently of the root logger. Problem Statement …

Creating loggers Read More »

Scroll to Top