Tag

log4j2

1 views collected around this technical thread.

Sanyou's Java Diary
Sanyou's Java Diary
Apr 17, 2025 · Backend Development

Why Does Log4j2 Async Logging Block Threads? Deep Dive & Solutions

Log4j2’s asynchronous logging can cause thread blocking when the Disruptor ring buffer fills, a problem explored through its architecture, root causes, and practical mitigation strategies such as dual‑track log classification, bytecode‑enhanced line‑level control, Maven plugins, and IDE integrations for dynamic log management.

Javaasynchronous logginglog4j2
0 likes · 13 min read
Why Does Log4j2 Async Logging Block Threads? Deep Dive & Solutions
Zhuanzhuan Tech
Zhuanzhuan Tech
Apr 16, 2025 · Backend Development

Analyzing Log4j2 Asynchronous Logging Blocking and Strategies for Fine-Grained Log Control

This article examines the causes of Log4j2 asynchronous logging blockage in high‑throughput Java services, explains the underlying Disruptor mechanics, and proposes a dual‑track logging architecture with compile‑time bytecode enhancement and IDE plugins for line‑level log activation.

JavaLogging Strategyasynchronous logging
0 likes · 15 min read
Analyzing Log4j2 Asynchronous Logging Blocking and Strategies for Fine-Grained Log Control
Architect's Guide
Architect's Guide
Apr 14, 2025 · Backend Development

Implementing TraceId‑Based Distributed Logging for Rest, MQ, and RPC Modules with Log4j2

This article explains how to generate a unique traceId for each request, propagate it through Rest, RocketMQ, and Dubbo RPC modules, and configure Log4j2 (including custom Message, MessageFactory, and PatternConverter) to output the traceId so that logs across services can be correlated and read sequentially.

AOPDubboJava
0 likes · 8 min read
Implementing TraceId‑Based Distributed Logging for Rest, MQ, and RPC Modules with Log4j2
Architect's Guide
Architect's Guide
Feb 25, 2025 · Backend Development

Performance Comparison and Usage Guide for Logback vs Log4j2 in Java Applications

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
Performance Comparison and Usage Guide for Logback vs Log4j2 in Java Applications
JD Tech Talk
JD Tech Talk
Dec 19, 2024 · Backend Development

Optimizing Log4j2 Asynchronous Logging: Configuration, Diagnosis, and Load‑Testing

This article presents a detailed case study of a severe service outage caused by Log4j2 asynchronous logging bottlenecks, explains step‑by‑step diagnostics of JVM, disk, and RingBuffer metrics, and demonstrates how adjusting log4j2.asyncQueueFullPolicy and log4j2.discardThreshold dramatically improves recovery time during load testing.

ConfigurationJavaPerformance Tuning
0 likes · 14 min read
Optimizing Log4j2 Asynchronous Logging: Configuration, Diagnosis, and Load‑Testing
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 12, 2024 · Backend Development

Understanding Spring Boot Integration with Log4j2 and Logback: Logging Mechanisms, Configuration, and Hot Level Updates

This article provides a comprehensive analysis of how Spring Boot integrates Log4j2 (and Logback), detailing the internal logging architecture, configuration options, initialization flow, logger groups, and how to perform hot updates of logger levels via the LoggersEndpoint or custom APIs.

ConfigurationHot UpdateJava
0 likes · 37 min read
Understanding Spring Boot Integration with Log4j2 and Logback: Logging Mechanisms, Configuration, and Hot Level Updates
Selected Java Interview Questions
Selected Java Interview Questions
Oct 3, 2024 · Backend Development

Spring Boot Log4j2 Integration and Logger Level Hot Update

This article explains how Spring Boot integrates Log4j2, details the internal logging initialization process, describes logger and LoggerConfig relationships, and demonstrates how to hot‑update logger levels using LoggersEndpoint or custom endpoints without restarting the application.

Hot UpdateLogger LevelSpring Boot
0 likes · 33 min read
Spring Boot Log4j2 Integration and Logger Level Hot Update
macrozheng
macrozheng
Aug 27, 2024 · Backend Development

Master Java Logging: Configure Logback & Log4j2 in Spring Boot

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.

JavaLogbackSlf4j
0 likes · 15 min read
Master Java Logging: Configure Logback & Log4j2 in Spring Boot
Selected Java Interview Questions
Selected Java Interview Questions
Feb 22, 2024 · Backend Development

Performance Comparison and Usage Guide for Log4j2 vs Logback in Java

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.

Java LoggingLogbackSpring Boot
0 likes · 14 min read
Performance Comparison and Usage Guide for Log4j2 vs Logback in Java
Java Architect Essentials
Java Architect Essentials
Oct 1, 2023 · Backend Development

The Importance of Logging, Log Levels, and Common Java Logging Frameworks (Log4j, Logback, SLF4J)

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.

FacadePatternJavaLogback
0 likes · 22 min read
The Importance of Logging, Log Levels, and Common Java Logging Frameworks (Log4j, Logback, SLF4J)
Selected Java Interview Questions
Selected Java Interview Questions
Sep 17, 2023 · Backend Development

Comprehensive Guide to Configuring Log4j2: Dependencies, Configuration Files, PatternLayout, Appenders, Loggers, and Asynchronous Logging

This article provides a detailed tutorial on Log4j2, covering how to add Maven dependencies, write XML configuration files, use PatternLayout placeholders, configure various Appenders and Filters, set up Loggers, enable asynchronous logging, and fine‑tune rolling file policies for Java backend applications.

Async loggingConfigurationJava Logging
0 likes · 21 min read
Comprehensive Guide to Configuring Log4j2: Dependencies, Configuration Files, PatternLayout, Appenders, Loggers, and Asynchronous Logging
iQIYI Technical Product Team
iQIYI Technical Product Team
Jul 28, 2023 · Operations

Distributed System Log Printing Optimization and Performance Evaluation

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.

Distributed SystemsLogbacklog optimization
0 likes · 16 min read
Distributed System Log Printing Optimization and Performance Evaluation
DataFunSummit
DataFunSummit
Aug 21, 2022 · Operations

Log4j2 Thread Blocking Causes and Mitigation Strategies

This article examines how excessive logging, AsyncAppender queue saturation, JVM reflection optimizations, and Lambda class loading can cause thread blocking in Log4j2, analyzes root causes with code examples, and provides practical guidelines and best‑practice configurations to prevent performance degradation in high‑throughput Java services.

AsyncAppenderJavaLoggingThreadBlocking
0 likes · 53 min read
Log4j2 Thread Blocking Causes and Mitigation Strategies
Top Architect
Top Architect
Apr 15, 2022 · Backend Development

Implementing Request Logging with Spring AOP and TraceId

This article demonstrates how to create a Spring AOP request‑logging aspect that captures IP, URL, HTTP method, class method, parameters, results and execution time, and extends it with high‑concurrency handling, error logging, and TraceId propagation for better traceability.

AOPJavaRequest Logging
0 likes · 13 min read
Implementing Request Logging with Spring AOP and TraceId
Dada Group Technology
Dada Group Technology
Mar 25, 2022 · Backend Development

Optimizing Log4j2 Logging: Reducing Disk and CPU Usage, Asynchronous Logging, and Traceability with ThreadLocal and TTL

This article presents a comprehensive approach to optimizing Log4j2 logging in high‑traffic Java services by reducing disk and CPU consumption through log level control and pattern tuning, adopting asynchronous logging, and enabling end‑to‑end request traceability using ThreadLocal, TransmittableThreadLocal, and MDC techniques, supported by performance test results and practical recommendations.

JavaTTLasynchronous logging
0 likes · 14 min read
Optimizing Log4j2 Logging: Reducing Disk and CPU Usage, Asynchronous Logging, and Traceability with ThreadLocal and TTL
Java Architect Essentials
Java Architect Essentials
Dec 30, 2021 · Information Security

Log4j2 Vulnerability and Logback Security: Remediation Recommendations

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.

LogbackPatch UpgradeSecurity Vulnerability
0 likes · 5 min read
Log4j2 Vulnerability and Logback Security: Remediation Recommendations
Top Architect
Top Architect
Dec 23, 2021 · Information Security

Understanding the Critical Log4j2 Vulnerability and Emergency Mitigation Measures

The article explains the Log4j2 remote code execution flaw caused by unsafe JNDI lookups, outlines its widespread impact on Java applications and major Chinese tech firms, and provides concrete emergency mitigation steps such as JVM parameter changes, firewall rules, and upgrading to version 2.17.0.

JavaVulnerabilityinformation security
0 likes · 7 min read
Understanding the Critical Log4j2 Vulnerability and Emergency Mitigation Measures