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.
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.
The article analyzes why logging in modern Spring Boot microservices shifts from a simple debug tool to a critical data pipeline, compares Logback and Log4j2 async setups, reveals hidden costs and risks, and walks through eight concrete production scenarios to build a controllable, high‑performance logging architecture.
This article details a production-grade logging system for Spring Boot microservices covering structured JSON output, MDC-based TraceId propagation across async threads and RPC calls, dynamic log level updates via Actuator or config centers, sensitive data masking, and disk protection strategies with async appenders and containerized log collection.
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.
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.
This article demonstrates how to build a production-ready global logging system in SpringBoot using MDC for trace IDs, a Filter for request interception, AOP for automatic request/response logging, and custom Jackson serializers for sensitive data masking, plus best practices for async logging and thread-pool context propagation.
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.
This article presents ten practical rules for producing clean, searchable, and performance‑friendly logs in Java applications, covering unified formatting, stack traces, log levels, complete parameters, data masking, asynchronous writing, traceability, dynamic log levels, structured storage, and intelligent monitoring with concrete code snippets and configuration examples.
This article presents ten practical guidelines for writing clean, consistent, and performant logs in Java applications, covering unified formatting, stack traces, appropriate log levels, complete parameters, data masking, asynchronous logging, dynamic log level control, trace ID propagation, structured JSON storage, and intelligent monitoring with ELK.
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.
This tutorial walks through implementing request tracing using MDC, configuring Logback's TurboFilter for dynamic log filtering, and creating custom filters in Spring Boot 3, complete with code examples, configuration snippets, and practical considerations for performance and correctness.
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.
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.
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.
SpringBoot’s out‑of‑the‑box defaults—such as Tomcat’s tiny connection pool, HikariCP’s 10‑thread limit, lazy‑loaded JPA entities, system‑timezone JSON serialization, un‑rolled Logback files, unlimited in‑memory cache, exposed Actuator endpoints, tiny file‑upload limits, per‑task thread creation for @Async, and unlimited transaction timeouts—can silently cripple production systems, so each must be reviewed and tuned for real‑world workloads.
A junior developer learns why logging is essential, how to use Logback and Lombok in Spring Boot, choose appropriate log levels, apply parameterized messages, control output volume, format logs, use asynchronous logging, manage log files, and integrate a log collection system for large-scale applications.
This article explains how to solve interleaved log lines in multi‑threaded pods by using a TraceId stored in SLF4J MDC, propagating it via HTTP headers, adapting thread pools and Spring task decorators, and integrating SkyWalking to enrich Logback patterns for end‑to‑end request tracing.
This article explains how to solve interleaved log lines in multi‑threaded pods by propagating a unique TraceId via HTTP headers and SLF4J MDC, integrating the approach with Spring filters, Feign interceptors, thread‑pool adapters, and SkyWalking for end‑to‑end tracing.
This guide explains how Spring Boot 3.x uses Logback by default, shows basic property‑based setup, advanced logback‑spring.xml configurations, profile‑specific logging, SQL tracing with Hibernate, MyBatis, p6spy and datasource‑proxy, plus MDC tracing, async logging, alerting and production best practices.
Learn how to set up Graylog for centralized log aggregation using Docker‑Compose, configure its inputs, and seamlessly integrate it with a Spring Boot application via Logback‑GELF, including necessary code snippets, configuration files, and query examples for efficient log searching.
Learn step‑by‑step how to set up Graylog using Docker‑Compose, configure its inputs, and connect a Spring Boot application via Logback‑GELF, enabling centralized log aggregation and searchable queries across multiple service instances in a micro‑services environment.
This article explains how chaotic, multi‑framework logging in Java microservices leads to debugging nightmares, and demonstrates a three‑step solution—standardizing on Logback, adding traceable MDC identifiers, and visualizing logs with ELK—to achieve unified log formats, sensitive data masking, and dramatically faster issue resolution.
This article shares ten practical rules for producing high‑quality logs in Java backend systems, covering unified formatting, stack traces, log levels, complete parameters, data masking, asynchronous logging, traceability, dynamic level adjustment, structured storage, and intelligent monitoring to help developers quickly diagnose issues and improve system reliability.
This article explains what a logging service is, compares ELK and custom appender solutions, shows how to create a Logback appender by extending AppenderBase, provides a complete Java example with configuration, and demonstrates the custom appender in action for backend developers.
This article shares ten practical guidelines for writing high‑quality logs in Java backend services, covering format consistency, stack traces, log levels, complete parameters, data masking, asynchronous logging, traceability, dynamic log levels, structured storage, and intelligent monitoring to improve debugging and system reliability.
The article explains how to combine SkyWalking’s distributed tracing capabilities with the ELK stack by embedding SkyWalking trace IDs into logs—using a custom Logback layout or MDC—so that microservice errors can be correlated across tracing and log visualisation, leveraging each tool’s strengths.
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.
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.
To remediate CVE‑2023‑6378 in a Spring Boot 2.7.x application, you must replace the default logging starter with a direct Logback 1.2.x dependency (e.g., 1.2.13), because Spring Boot 2.7 cannot use Logback 1.3.x due to the removed StaticLoggerBinder class; the only other option is to upgrade the whole stack to Spring Boot 3.x, Logback 1.4.x, and JDK 11.
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.
This article explains how to solve interleaved logs in multi‑threaded pods by adding a unique X‑App‑Trace‑Id header, propagating it through a TraceIdFilter, storing it in SLF4J MDC, adapting Feign and thread pools, and integrating SkyWalking to enrich log patterns with trace identifiers.
Learn how to protect personal data in Spring Boot 3.2.5 applications by customizing Logback's PatternLayout and appender to mask fields such as name, phone, password, and email, with step‑by‑step code examples, configuration snippets, and handling of object logging.
After upgrading from Tomcat 7 to Tomcat 8, the application’s mixed log4j‑1.4 and logback‑1.2.3 dependencies caused the SLF4J binder to be loaded nondeterministically, so Tomcat 8 sometimes selected the Log4j binder without a configuration file, resulting in completely missing log output; removing the conflicting jars or enforcing a deterministic class‑loading order restored logging.
The article explains how to solve interleaved multi‑thread logs in micro‑services by adding a X‑App‑Trace‑Id header, extracting it in a TraceIdFilter, storing it in SLF4J MDC, propagating it through Feign, adapting it for child threads, and finally integrating SkyWalking to print both application and SkyWalking trace IDs in Logback.
This article explains how Spring Boot handles graceful shutdown in Kubernetes, manual Actuator shutdown, SIGTERM handling, Tomcat graceful termination, and Logback log flushing, providing detailed code examples, configuration snippets, and the underlying shutdown hook mechanisms that ensure resources are released cleanly.
This article explains how to generate a unique TraceId, propagate it via HTTP headers and SLF4J MDC, integrate the mechanism with Logback, Feign clients, thread pools, and SkyWalking, and details the underlying MDC and Logback placeholder implementations for reliable log tracing in Java backend applications.
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.
This guide shows how to implement end‑to‑end trace ID propagation across Spring Cloud gateways, downstream services, and asynchronous threads using a custom GlobalTraceFilter, a patched LogbackMDCAdapter with Alibaba TransmittableThreadLocal, and minimal configuration, avoiding heavyweight tracing libraries.
This article walks through the complete troubleshooting process for a non‑functional logback‑spring.xml in a Spring Boot application, covering background, configuration steps, common pitfalls such as variable resolution and dependency conflicts, remote debugging techniques, and final recommendations to ensure proper log output.
This article explains how to use SLF4J MDC together with a TraceId header to correlate logs across threads, services, and distributed tracing tools like SkyWalking, providing code examples for filters, Feign interceptors, thread‑pool adapters, and Logback configuration.
This article details the investigation of sporadic interface timeouts in the Sirius real‑time pricing service, revealing a weekly pattern linked to RAID controller consistency checks that cause IO spikes, logback queue blockage, and ultimately Dubbo client‑side timeouts, and proposes mitigation steps and general performance‑troubleshooting guidelines.
This tutorial explains how to deploy Graylog using Docker‑Compose for centralized log aggregation in a microservices environment and shows step‑by‑step integration of Graylog with a Spring Boot application via Logback‑GELF, including configuration, code examples, and basic log search queries.
This tutorial walks through setting up Spring Cloud Sleuth with Spring Boot 2.6.8 and Spring Cloud 2021.0.3 to capture and visualize distributed trace data via Zipkin, covering project creation, Maven dependencies, YAML configuration, OpenFeign integration, exception handling, RabbitMQ transport, and logback pattern adjustments.
This article compares the performance of Log4j2 and Logback in Java, explains their relationship with SLF4J, presents benchmark results under various thread counts, and provides detailed configuration and usage guidelines for both Spring Boot and plain Java projects.
This article walks through creating a standardized JSON response structure with a Result enum and wrapper class, demonstrates how to return it from controllers, implements a @ControllerAdvice‑based global exception handler with custom exceptions, and configures Logback for comprehensive logging in Spring Boot applications.
This article explains the fundamentals of buffering, demonstrates how Java I/O streams and Logback logging use buffers to improve performance, explores synchronous and asynchronous buffering strategies, and discusses Kafka producer buffering with practical code examples and optimization guidelines.
This article explores Java logging performance by analyzing the logging pipeline, presenting measurements of log size impact, and offering concrete optimization techniques such as reducing log payload, compressing logger and exception output, using asynchronous logging, and configuring rolling files to minimize both visible business overhead and hidden system costs.
The article explains why logging API request and response parameters is essential for debugging, shows how to configure environment‑ and interface‑level switches, defines a simple @ApiLog annotation, implements an AOP aspect that records request details and response results, and demonstrates separating logs via Logback configuration while noting performance considerations.
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.
This guide explains how Spring Boot’s default logging uses Logback with Commons Logging, details the console log format, color coding, file output options, rolling policies, log levels, logger groups, and advanced customizations through logback‑spring.xml and environment properties.
After a Java system went live, a disk usage alert exceeding 90% prompted an investigation that uncovered a third‑party jar’s debug‑level Log4j configuration writing large logs to the root directory, and the issue was resolved by excluding the offending jar via Maven, highlighting the need for careful dependency management.
This guide explains Spring Boot 2.4.12 logging fundamentals, covering default console output, customizable patterns, colored logs, file rotation, log levels, logger groups, and advanced Logback extensions, with practical YAML and XML examples for fine‑tuning your application's logging behavior.
The study evaluates log4j2 and logback performance, recommends asynchronous logback for high‑concurrency workloads, demonstrates latency reductions in a production service, and introduces a TraceContext‑based flag to share logging state across micro‑services, cutting daily log volume by ~80 % and easing distributed system overhead.
This guide explains how to add a unique traceId to each request in a Spring Boot application, configure Logback/MDC to record it, propagate the ID across microservice calls and asynchronous threads using OpenFeign, RestTemplate, and TransmittableThreadLocal, enabling complete distributed log tracing.
This article explains how to securely mask sensitive data in log output by using either a conversionRule tag with MessageConverter or a custom utility class, and provides a step‑by‑step guide to integrate a reusable Logback desensitization component with Maven dependency, appender replacement, and YAML configuration.
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.
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.
This article explores the fundamentals and practical benefits of buffering in Java applications, covering file I/O streams, Logback asynchronous logging, and Kafka producer batching, while providing code examples, configuration tips, optimization strategies, and cautions to avoid data loss.
This article explains the principle of buffering, illustrates its benefits with Java file I/O, Logback asynchronous logging, and Kafka producer batching, and provides practical optimization ideas, code examples, and cautions for both synchronous and asynchronous buffer designs.
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.
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.
This article details a step‑by‑step investigation of a Java Spring‑Boot service that suffered nightly response‑time alerts, revealing that misconfigured Logback file paths caused cross‑volume log rotation, thread blocking, and ultimately a production outage, and shows how gray‑deployment and environment fixes resolved the issue.
This article introduces a Logback desensitization component for Java applications, explains two common masking approaches, compares their pros and cons, and provides step‑by‑step instructions—including Maven dependency, appender replacement, YAML configuration, supported data types, matching rules, custom regex, and jar installation—to securely mask sensitive information in logs.
This article explains how to use MDC to generate and propagate a traceId across Spring Cloud microservices, configure Logback to output the traceId, and leverage ELK Stack for log aggregation, enabling comprehensive request‑level log tracing both within and across services.
The article explains how AsyncAppender uses a BlockingQueue with a default size of 256, how an oversized queue can cause OOM, how the discardingThreshold can lead to loss of TRACE/DEBUG/INFO logs, and provides configuration tips such as adjusting queueSize, setting discardingThreshold to zero, or enabling neverBlock to avoid blocking.
This guide explains how to set up distributed logging for microservices using Spring Cloud Sleuth for tracing, Zipkin as a trace UI, and the ELK stack (Elasticsearch, Logstash, Kibana) for log collection, storage, and visualization, including detailed configuration and code examples.
This article demonstrates how to set up distributed logging for Spring Cloud microservices using Sleuth for tracing and the ELK stack (Elasticsearch, Logstash, Kibana), covering dependency configuration, service registration, Logback setup, Logstash pipelines, and log querying in Kibana.
This article explains how to configure Logback in a Spring Boot application to separate logs by level, implement asynchronous logging with AsyncAppender, and compare performance using JMeter, demonstrating a tenfold throughput increase while providing detailed XML configuration examples and underlying implementation details.
This article explains how to configure Logback for asynchronous logging in Spring Boot, separates logs by level, reduces disk I/O, and demonstrates a performance test that shows a ten‑fold throughput increase compared to synchronous logging.
This article explains how to configure Logback in Spring Boot to separate logs by level, use asynchronous appenders to reduce I/O latency, and demonstrates a performance test showing a ten‑fold throughput increase, while also detailing the underlying async logging mechanism.
This article outlines the Log4j2 security vulnerability, notes that Logback shares the same flaw, and provides comprehensive remediation advice—including upgrading to Log4j2 2.17, coordinating development and security teams, testing environments, JDK updates, and consulting professional security services.
This article explains the Logback vulnerability CVE‑2021‑42550 affecting versions before 1.2.7, detailing how malicious configuration files can lead to remote code execution via LDAP, outlines trigger conditions, affected versions, provides a SpringBoot demo for exploitation, and offers practical mitigation advice.
This guide explains how to set up distributed logging for microservices using Spring Cloud Sleuth, Zipkin, and the ELK stack, covering dependency configuration, service registration, Logstash and Kibana setup, logback-spring.xml customization, and log querying to trace inter‑service calls.
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.
This guide explains how to set up distributed tracing for Spring Cloud microservices using Sleuth and Zipkin, integrate logs with the ELK stack, configure Logback for Logstash output, and query traces in Kibana, providing step‑by‑step code and configuration examples.
This article explains the Logback CVE‑2021‑42550 vulnerability affecting versions before 1.2.9, outlines the three conditions required for exploitation, compares its severity to Log4j, and provides concrete steps—including upgrading to 1.2.9 and setting the configuration file read‑only—to protect Java applications.
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.
This article provides an in‑depth overview of Logback, covering its core modules, component relationships, configuration files, code examples for console, file, and rolling appenders, as well as practical integration tips for Spring Boot and servlet containers.
This article explains Java logging fundamentals, the purpose of each log level, practical best‑practice guidelines, and how to implement a custom Logback appender that injects request IDs for effective distributed debugging and seamless ELK integration.
This article explains Java logging fundamentals, the four standard log levels, practical best‑practice guidelines, and how to implement a custom Logback appender that injects a request ID for better traceability in distributed systems using ELK and Kafka.
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.
This article explains Spring Boot's default logging setup using SLF4J and Logback, demonstrates how to view log levels in a test class, shows how to modify log levels via application properties, and details the underlying XML configuration files and how to customize them for different environments.
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.
This guide explains why Nacos generates massive access logs, shows how to disable the Tomcat access log via configuration, provides a cron script for log cleanup, demonstrates dynamic log‑level adjustment through API calls, and details fine‑grained logback settings for better log management.
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.
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.
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.
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.
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.
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.
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.
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.
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.
The article explains typical Logback misconfigurations—such as logger inheritance errors and improperly set LevelFilter—that cause duplicate log entries, and provides step‑by‑step corrections like disabling additivity and configuring filter attributes to eliminate redundant logging.