Tagged articles
SLF4J
72 articles · Page 1 of 1
This article dissects Spring Boot's logging system initialization sequence, the two-phase LoggingSystem setup, and the four-tier configuration priority chain from explicit logging.config down to application.yml logging.* properties, with source-code walkthroughs and practical logback-spring.xml examples.
ConfigurationInitializationLog4j2
0 likes · 15 min read

This article explains Spring Boot's logging architecture, the early initialization process driven by LoggingApplicationListener, the three‑layer design with SLF4J, bridge packages and Logback, configuration file loading order, differences between logback.xml and logback‑spring.xml, and common troubleshooting steps.
ConfigurationJavaLog4j2
0 likes · 16 min read

A benchmark shows log4j2 can be roughly twice as fast as logback, especially when thread count approaches twice the CPU cores, while logging method names and line numbers significantly degrade throughput; the article explains the underlying reasons, testing setup, and provides practical configuration and usage guidelines for both frameworks in Java and Spring projects.
Java loggingLog4j2Logback
0 likes · 16 min read

The article explains why effective logging is crucial for Java applications, compares proper and improper logging practices with SLF4J and Logback, and provides fourteen concrete best‑practice guidelines—including correct logger setup, level usage, placeholders, asynchronous and structured logging—to avoid performance degradation and security risks.
JavaLogbackSLF4J
0 likes · 14 min read

This guide details how to select a Java logging framework, defines a decision tree for when to log, maps log levels (ERROR, WARN, INFO, DEBUG) to concrete scenarios, provides code‑handling principles, outlines prohibited logging patterns, and includes a quick reference for alerting rules.
Best PracticesJavaLogging
0 likes · 12 min read

This article explains why logs are essential for debugging and incident analysis, introduces the SLF4J façade to decouple applications from concrete logging implementations, details Spring Boot Logback setup, and provides concrete best‑practice guidelines such as proper log levels, formatting, rolling policies, placeholder usage, and safe exception handling.
LogbackLoggingSLF4J
0 likes · 10 min read

This tutorial explains why System.out.println() is unsuitable for production logging, shows how to add SLF4J and Logback dependencies, configure logback.xml, use Lombok's @Slf4j annotation to generate a logger, and provides practical code examples for unified API logging and exception tracking.
JavaLogbackLogging
0 likes · 9 min read

This guide explains why logging is essential in Java, explores its various uses such as system monitoring, data collection, and audit, demonstrates how to print logs with SLF4J in Spring Boot, and provides detailed instructions for configuring log levels, persistence, file rotation, formatting, and Lombok shortcuts.
LogbackLoggingLombok
0 likes · 18 min read

Learn why logging is essential in Java applications, explore Spring Boot’s built‑in SLF4J framework, discover how to print, configure levels, persist logs, customize formats, manage file rotation, and simplify logging with Lombok, all through clear examples and practical guidance.
JavaLogbackLogging
0 likes · 17 min read

This article explains why traditional System.out printing is insufficient, introduces Spring Boot's built‑in SLF4J/Logback logging, demonstrates how to obtain and use a logger, details log levels, configuration of log levels, file persistence, rolling policies, formatting, and shows how Lombok's @Slf4j annotation can simplify logger usage.
ConfigurationLogbackLogging
0 likes · 17 min read

This article explains why MyBatis's default StdOutImpl logging, which relies on System.out.println, blocks threads and creates severe concurrency bottlenecks, and demonstrates how to replace it with asynchronous logging implementations like Slf4jImpl, configure log levels, and even create custom Log classes for optimal performance.
ConcurrencyJavaLogging
0 likes · 8 min read

This article compares the performance of Logback and Log4j2, presents benchmark results under various thread counts, explains their relationship with SLF4J, and provides step‑by‑step configuration and usage instructions for both frameworks in Spring Boot projects, including best practices and sample code.
Java loggingLogbackSLF4J
0 likes · 15 min read

The article explains why logging is essential for problem tracing, status monitoring, and security auditing, introduces Log4j, Log4j2, and Logback components and configuration files, demonstrates usage with Maven dependencies and code snippets, evaluates their synchronous and asynchronous performance, and offers practical recommendations for production environments.
Java loggingLog4j2Logback
0 likes · 28 min read

This guide explains why System.out.println is unsuitable for production, compares Java logging frameworks such as Log4j2, Logback and SLF4J, shows how to integrate them with code and Lombok, and provides comprehensive best‑practice recommendations on log levels, formatting, volume control, rolling policies, asynchronous logging and log aggregation.
Best PracticesJavaLog4j2
0 likes · 18 min read


ITPUBNov 24, 2024 · Backend Development
This guide explains why logging is essential for Java applications, compares popular logging frameworks such as Logback, Log4j2, and SLF4J, shows how to integrate them with Spring Boot, and provides concrete best‑practice recommendations for levels, formatting, async handling, rotation, and security.
Best PracticesJavaLog4j2
0 likes · 17 min read

This article explains how to use SLF4J as a facade for Logback or Log4j2, shows Maven dependencies, demonstrates logback.xml and logback‑spring.xml configurations, covers Spring Boot's default logging setup, custom log levels, profile‑based settings, and how to switch to Log4j2 for higher performance.
JavaLog4j2Logback
0 likes · 15 min read

This article presents twelve practical guidelines for Java logging, covering interface‑layer usage, avoiding separator lines, preventing logging‑induced exceptions, leveraging Fastjson features, preserving exception stacks, limiting message length, merging stack traces, skipping costly placeholders, avoiding console output, discarding redundant utilities, and adhering to Alibaba's logging specification.
Best PracticesSLF4Jerror handling
0 likes · 11 min read

This article explains how to use SLF4J's MDC to tag logs with a request ID, why the ID is lost in asynchronous threads, and how to apply a decorator pattern (MDCRunnable) so that the request ID is correctly propagated and searchable across all threads and thread pools.
DebuggingJavaLogging
0 likes · 9 min read

This article analyzes the growing risk of personal data leakage, defines data masking, compares common log‑masking techniques, and presents a comprehensive Java‑Spring solution that combines annotation‑based marking, custom Jackson serializers, and extended SLF4J methods to achieve precise, low‑overhead log masking.
SLF4JSpringdata masking
0 likes · 8 min read

To correctly implement Java logging, choose a compatible framework‑system pair such as SLF4J with Logback, configure Maven dependencies and a rolling Logback XML, use MDC for context, enable dynamic level changes, avoid custom wrappers, and follow a checklist for cleanup and troubleshooting.
ConfigurationLoggingSLF4J
0 likes · 13 min read

This tutorial shows how to build a lightweight request‑tracing solution in SpringBoot 3.2 using SLF4J, MDC, custom filters, logback configuration, and a global ResponseBodyAdvice to log and return trace IDs for improved debugging and observability.
JavaMDCSLF4J
0 likes · 10 min read

This article explains why logging is crucial in software development, introduces the standard log levels, reviews popular Java logging libraries such as Log4j, Logback and SLF4J, demonstrates their configuration and usage, compares their features, and highlights the Facade design pattern that underlies SLF4J.
FacadePatternJavaLog4j2
0 likes · 22 min read

This article explains Java’s Service Provider Interface (SPI) mechanism, compares it with traditional APIs, demonstrates how to define interfaces, implement services, and discover them using ServiceLoader, and shows real‑world applications such as Spring Boot auto‑configuration and logging frameworks like SLF4J.
Auto-configurationJavaSLF4J
0 likes · 13 min read

This article explains how the delegation pattern is applied in Java server development by examining SLF4J's facade design, JDBC's driver registration, and Apache Dubbo's SPI mechanism, providing practical guidance on when and how to use delegation in backend projects.
DubboJDBCJava
0 likes · 18 min read

The article explains how the delegation pattern—combining a fixed core processing path with extensible open interfaces—underpins Java toolkits such as SLF4J, JDBC, and Dubbo, illustrating its implementation steps, when to apply it, and pitfalls like reverse delegation loops.
Apache DubboJDBCJava logging
0 likes · 17 min read

This article explains how to use SLF4J's MDC feature to attach a request ID to log entries, demonstrates the limitation of MDC in asynchronous threads, and provides a decorator‑based solution (MDCRunnable) that propagates the context to child threads and thread pools.
JavaMDCMultithreading
0 likes · 10 min read

This article explains how to use SLF4J's MDC to attach a request identifier to log entries, demonstrates the limitation of MDC in asynchronous threads, and provides a decorator‑pattern solution (MDCRunnable) that propagates the context, enabling reliable log correlation across threads in Java backend applications.
BackendDecoratorPatternJava
0 likes · 10 min read

This tutorial explains how Spring Boot handles logging with Commons Logging, demonstrates using SLF4J as a facade, shows a complete code example, and covers configuring log output, levels, color, file rotation, and custom patterns for effective backend logging.
ConfigurationLogbackLogging
0 likes · 11 min read

This article explains how to integrate Logback with SLF4J in Spring Boot, covering dependency setup, default and custom configurations via logback‑spring.xml, detailed element descriptions, and best‑practice logging code examples, including file rolling policies and performance considerations.
ConfigurationLogbackLogging
0 likes · 23 min read

This guide explains why Logback is the preferred logging framework for Spring Boot, shows how to add the necessary dependencies, configure console and file appenders, customize log patterns, use rolling policies, apply filters, and optimize logging statements with placeholders, all illustrated with clean XML and Java code examples.
JavaLogbackLogging
0 likes · 23 min read

This article explains why Logback is preferred over Log4j, shows how to add the necessary Maven dependencies, describes default and custom configurations via logback‑spring.xml, details logger, appender, layout, rolling policies and filters, and provides best practices for efficient logging in Spring Boot applications.
ConfigurationJava loggingLogback
0 likes · 21 min read

JetBrains announced that the IntelliJ platform will discontinue Log4j usage, recommending java.util.logging as the standard logging framework, and provides detailed migration steps, security reasons, and version information for developers to adapt their plugins and dependencies.
IntelliJLoggingSLF4J
0 likes · 6 min read

This guide explains how Spring Boot handles logging through Commons Logging, recommends using SLF4J as a facade, shows code examples, details log elements, demonstrates how to enable DEBUG, configure console colors, file output, rolling policies, level control, and custom formats for effective backend logging.
ConfigurationLogbackLogging
0 likes · 11 min read

tinylog2 is an open-source, lightweight Java logging framework that supports JVM languages, offers a static Logger API, SLF4J adaptation, multiple output options, configurable properties or YAML/JSON, high performance benchmarks, and a small footprint, making it a secure alternative to log4j2.
JavaSLF4Jperformance
0 likes · 5 min read

Apache Log4j 2.16.0 has been released, offering updated SLF4J adapters, disabling JNDI by default to mitigate CVE‑2021‑44228, removing message lookups, and requiring Java 8+, with detailed upgrade instructions and links to download and issue trackers.
JNDIJavaLogging
0 likes · 4 min read

This article explains why multiple Java logging frameworks often clash in SpringBoot and Dubbo applications, identifies common causes such as transitive dependencies and duplicate versions, and provides step‑by‑step Maven configurations and adaptation techniques to unify logging with SLF4J and Logback.
DubboJavaLogback
0 likes · 13 min read

This article demonstrates how to employ SLF4J's MDC to attach a request identifier to log entries, enabling efficient filtering of all logs belonging to a single request even across asynchronous threads and thread pools, and shows an advanced decorator‑based solution for proper MDC propagation.
JavaLoggingMDC
0 likes · 9 min read

This guide explains how MyBatis initializes its logging factory, shows how to add SLF4J and Log4j dependencies, configure SimpleLogger properties, resolve multiple SLF4J bindings, and switch the logging implementation via mybatis-config.xml and log4j.properties, with full code examples and sample output.
BackendJavaLogging
0 likes · 11 min read

Effective logging is crucial for debugging and accountability; this guide presents fifteen practical recommendations—from selecting appropriate log levels and formatting to using SLF4J, asynchronous output, and avoiding common pitfalls—designed to help Java developers write clear, performant, and maintainable logs.
LogbackLoggingSLF4J
0 likes · 12 min read

This article presents fifteen practical guidelines for effective Java logging, covering log levels, parameter tracing, formatting, conditional logging, performance‑friendly APIs, asynchronous output, proper exception handling, and log file organization to help developers quickly locate issues and maintain clean, efficient logs.
Best PracticesDebuggingJava
0 likes · 10 min read

This article presents 15 practical logging best‑practice recommendations for Java developers, covering log level selection, formatting, conditional logging, performance‑friendly placeholders, asynchronous output, proper exception handling, and log file organization to improve debugging efficiency and maintainable production systems.
Best PracticesDebuggingLogback
0 likes · 11 min read

This article presents fifteen practical guidelines for logging in Java, covering proper log levels, parameter logging, formatting, conditional logging, log level guards, SLF4J usage, placeholder syntax, asynchronous output, exception handling, production debug policies, avoiding duplicate logs, file separation, and detailed logging for core modules.
DebuggingJavaSLF4J
0 likes · 9 min read

This article explains how calling LOGGER.info with JSON serialization in a production environment set to WARN can waste CPU cycles, cause latency spikes, and even bring down high‑concurrency systems, and it offers a simple guard‑clause solution.
JSON SerializationJavaSLF4J
0 likes · 5 min read

This article explains how SLF4J’s Mapped Diagnostic Context (MDC) leverages ThreadLocal to embed trace and span identifiers into log messages, demonstrates configuring log4j2 patterns, shows code for injecting and clearing MDC values during span lifecycle, and addresses MDC propagation in asynchronous threads using Transmittable ThreadLocal.
Log4j2MDCSLF4J
0 likes · 4 min read

This guide explains how to use SLF4J with Logback, when and how to log at different levels, proper message formatting with placeholders, avoiding string concatenation, and provides practical code examples for ERROR, WARN, INFO, DEBUG, and TRACE logging in Java applications.
JavaLogbackSLF4J
0 likes · 8 min read

Logback, the open‑source logging framework created by the log4j founder, offers faster performance, extensive testing, native SLF4J support, flexible configuration, automatic reload, advanced appenders and rolling policies, making it a superior replacement for log4j in modern Java backend applications.
JavaLogbackLogging
0 likes · 22 min read

This article explains best practices for using the SLF4J façade with Logback, covering when to log, proper log levels, parameterized message formatting, avoiding string concatenation, and guidelines for error, warning, info, debug, and trace logging in Java backend systems.
Best PracticesJavaLogback
0 likes · 8 min read

This article explains why multiple Java logging frameworks often clash in SpringBoot and Dubbo projects, outlines the root causes such as transitive dependencies and duplicate versions, and provides step‑by‑step Maven configurations and adaptation techniques to unify logging under a single implementation.
DubboJavaMaven
0 likes · 13 min read

This article explains the evolution and inter‑relationships of Java logging libraries such as JCL, SLF4J, Log4j, Logback and JUL, shows how to choose and configure adapters to achieve unified logging across frameworks, and provides troubleshooting tips and coding guidelines.
JavaLogbackLogging
0 likes · 7 min read

This article explains the evolution, relationships, and dependencies of Java logging libraries such as Log4j, JUL, JCL, SLF4J, and Logback, and provides practical guidance on configuring adapters, solving common conflicts, and unifying logging output across frameworks like Spring.
JavaLogbackLogging
0 likes · 8 min read

This article explains the evolution, relationships, and dependencies of Java logging frameworks such as JCL, SLF4J, Log4j, Logback, and JUL, and provides practical guidance on configuring and unifying logging output across projects, including common pitfalls and adapter usage.
LogbackSLF4Jjcl
0 likes · 7 min read

This article explains the evolution and inter‑relationships of Java logging libraries such as Log4j, JUL, JCL, SLF4J and Logback, shows how to configure adapters to unify logging across frameworks, addresses common runtime issues, and provides coding‑style recommendations for consistent log output.
BackendJavaLogback
0 likes · 7 min read


21CTODec 17, 2020 · Backend Development
This article explains the evolution and relationships of Java logging libraries, shows how to resolve common issues like missing logs or jar conflicts, and provides practical guidance for configuring unified logging across frameworks such as SLF4J, Logback, Log4j, and Spring.
BackendJavaLogback
0 likes · 8 min read

This guide explains the relationships and dependencies among Java logging frameworks such as Log4j, SLF4J, Logback, and JUL, shows how to resolve common issues like missing logs or jar conflicts, and provides practical steps to unify logging output across different modules and libraries.
JULJavaLogback
0 likes · 8 min read

This article explains the evolution and inter‑dependencies of Java logging frameworks such as JCL, Log4j, JUL, SLF4J and Logback, shows how to configure them to avoid jar conflicts and missing logs, and provides practical steps and troubleshooting tips for unified logging in Java projects.
FrameworksJavaLogback
0 likes · 8 min read

This article explains the adapter pattern, illustrates its role in SLF4J by analyzing the Logger interface, Log4jLoggerAdapter, and related factory code, compares object and class adapters, and discusses the pattern's advantages and drawbacks in Java logging frameworks.
JavaLoggingSLF4J
0 likes · 11 min read

This article explains MyBatis's logging architecture, covering the supported log implementations, the role of SLF4J, how MyBatis selects and configures a logger via LogFactory, and the use of JDK dynamic proxies to route JDBC logging through separate logger objects.
BackendJavaLogging
0 likes · 8 min read

This article examines the SLF4J LoggerFactory bind method, explains how the SPI mechanism discovers and selects a logging implementation, outlines the steps and warnings when multiple or no providers are present, and offers practical advice for managing bindings in Java projects.
BindingJavaLoggerFactory
0 likes · 7 min read

This article explains how MyBatis loads and categorizes logging implementations, details the role of SLF4J and other frameworks, describes the LogFactory adapter selection process, and shows how JDBC log proxies use dynamic proxies to output SQL execution details.
JDBCJavaLogFactory
0 likes · 8 min read

This article examines SLF4J's source code to explain how the framework uses a double‑checked locking pattern with a volatile provider field to safely initialize its LoggerFactory, detailing each step, the underlying Java memory model issues, and a classic singleton example.
Java ConcurrencySLF4Jdouble-checked locking
0 likes · 7 min read

This article surveys the major Java logging frameworks—including Log4j, Log4j2, Logback, SLF4J, J.U.L, and Jakarta Commons Logging—explains their histories, architectural differences, typical use‑cases, and provides practical guidance for selecting the most suitable option for new projects.
JULJavaLogback
0 likes · 9 min read

This article explains how to choose and integrate Java logging frameworks, use SLF4J with Logback, understand Spring Boot's default logging setup, customize log output, and switch between implementations such as Log4j2, providing practical code snippets and configuration examples.
ConfigurationJavaLogback
0 likes · 10 min read

This article explains how to seamlessly replace Spring Boot's default Logback logging framework with alternatives like Log4j2 by leveraging the SLF4J facade, covering version requirements, dependency management, configuration files, and detailed XML examples for various log levels.
BackendJavaLog4j2
0 likes · 11 min read

This article explains why SLF4J with Logback is the preferred logging façade for Java back‑ends, when to log, how to format messages using parameterized placeholders, and the correct usage of each log level with clear do‑and‑don’t code examples.
Best PracticesDebuggingJava
0 likes · 8 min read

This guide explains why to use the SLF4J façade with Logback, when to log, proper parameterized message formats, level‑specific conventions for ERROR, WARN, INFO, DEBUG, and TRACE, and provides concrete code examples for clean, performant logging in Java applications.
JavaLogbackLogging
0 likes · 10 min read

This article explains the importance of logging in Java web applications, reviews the most popular logging frameworks, introduces the concept of a logging facade, and shows why using SLF4J (or similar facades) is the best practice to reduce coupling and simplify future framework changes.
Facade PatternJavaLogging
0 likes · 8 min read

This article provides a detailed overview of Java logging frameworks—including Log4j, Log4j 2, Commons Logging, SLF4J, Logback, and JUL—covers their history, relationships, implementation mechanisms, practical selection guidelines, SLF4J usage patterns, source‑code analysis, bridge solutions for legacy APIs, and strategies for excluding unwanted logging dependencies.
BackendLogbackLogging
0 likes · 16 min read

This article provides a comprehensive overview of the major Java logging frameworks—including Log4j, Log4j2, Commons Logging, SLF4J, Logback, and JUL—covers their history, relationships, implementation mechanisms, and offers practical guidance on selecting and integrating them in projects.
JULLogbackLogging
0 likes · 13 min read

This article provides a comprehensive guide to Java logging frameworks, detailing the roles of SLF4J, Log4j, Logback, and Log4j2, comparing their architectures, showing how to configure each with XML files and Maven dependencies, and offering practical code examples and troubleshooting tips.
JavaLog4j2Logback
0 likes · 25 min read

This article explains the purpose of each log level, when to write logs, performance impacts, and concrete best‑practice patterns for INFO, DEBUG, WARN and ERROR in Java applications, providing actionable templates and configuration tips to build a robust logging system.
Best PracticesLoggingOperations
0 likes · 19 min read

The article explains the design, implementation, and operational benefits of a middleware component that dynamically adjusts log levels in Java services, helping large‑scale delivery platforms balance comprehensive debugging information with system performance and avoid catastrophic failures during peak traffic.
Backend PerformanceJavaSLF4J
0 likes · 13 min read

This guide explains how to integrate and switch among Java logging libraries—including JDK logging, Log4j 1, Log4j 2, Logback, Commons‑Logging, and SLF4J—by using bridge jars, configuring dependencies, and understanding conflict resolution for seamless migration.
LogbackLoggingSLF4J
0 likes · 16 min read
