Tagged articles
89 articles
Page 1 of 1
Architect's Tech Stack
Architect's Tech Stack
Sep 25, 2025 · Backend Development

Auto‑Inject UserId and OrderId into Logs with Spring AOP and MDC

This article explains how to eliminate manual logging of user and order identifiers in Java e‑commerce services by using Log4j2 placeholders, ThreadLocal, MDC, a custom @UserLog annotation, and Spring AOP to automatically enrich log messages with these contextual fields.

ThreadLocalannotationjava logging
0 likes · 9 min read
Auto‑Inject UserId and OrderId into Logs with Spring AOP and MDC
dbaplus Community
dbaplus Community
Jun 1, 2025 · Backend Development

Why Log4j2 Async Logging Blocks Threads and How to Fix It

This article examines Log4j2 asynchronous logging bottlenecks, explains the underlying Disruptor queue mechanics, identifies root causes of thread blocking, and presents practical strategies—including queue tuning, log classification, bytecode instrumentation, and IDE plugins—to achieve fine‑grained, performant log control.

DisruptorIDE pluginLog Management
0 likes · 12 min read
Why Log4j2 Async Logging Blocks Threads and How to Fix It
Architect
Architect
May 24, 2025 · Backend Development

Implement End‑to‑End TraceId Logging Across Rest, MQ, and RPC in Java

This article walks through a practical approach to generate a unique traceId at request entry, propagate it through REST, RocketMQ, and Dubbo RPC modules, and configure Log4j2 to print the traceId so that logs from different services can be correlated into a single request chain.

Distributed TracingJavaMicroservices
0 likes · 8 min read
Implement End‑to‑End TraceId Logging Across Rest, MQ, and RPC in Java
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
Pan Zhi's Tech Notes
Pan Zhi's Tech Notes
Feb 12, 2025 · Backend Development

Comprehensive Guide to Log Configuration and Performance Comparison of Major Java Logging Frameworks

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 logginglog4jlog4j2
0 likes · 28 min read
Comprehensive Guide to Log Configuration and Performance Comparison of Major Java Logging Frameworks
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.

ConfigurationJavaRingBuffer
0 likes · 14 min read
Optimizing Log4j2 Asynchronous Logging: Configuration, Diagnosis, and Load‑Testing
JD Cloud Developers
JD Cloud Developers
Dec 19, 2024 · Backend Development

How Discard Policy and Error Threshold Rescue Java Services During Log Overload

This article analyzes a severe service‑availability drop caused by Log4j2 asynchronous logging bottlenecks, explains how configuring log4j2.asyncQueueFullPolicy=Discard and log4j2.discardThreshold=ERROR mitigates the issue, details the investigation steps, performance tests, and provides practical recommendations for robust backend logging.

Java backendPerformance Testingasynchronous logging
0 likes · 15 min read
How Discard Policy and Error Threshold Rescue Java Services During Log Overload
dbaplus Community
dbaplus Community
Dec 9, 2024 · Backend Development

Master Java Logging: Framework Choices, Best Practices, and Real-World Tips

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.

Javabest practiceslog4j2
0 likes · 18 min read
Master Java Logging: Framework Choices, Best Practices, and Real-World Tips
ITPUB
ITPUB
Nov 24, 2024 · Backend Development

Master Java Logging: Frameworks, Best Practices, and Real‑World Tips

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.

JavaSpring Bootbest practices
0 likes · 17 min read
Master Java Logging: Frameworks, Best Practices, and Real‑World Tips
Architect
Architect
Nov 22, 2024 · Backend Development

Why Is Async Log4j2 Logging So Slow? A Deep Dive into Disruptor and JNI Overheads

The article investigates a severe performance bottleneck in a Java service caused by massive async Log4j2 logging, analyzes the Disruptor‑based async logger, explores JNI stack‑trace overhead, reproduces the issue with benchmarks, and provides practical recommendations to eliminate the slowdown.

DisruptorJNIJava
0 likes · 18 min read
Why Is Async Log4j2 Logging So Slow? A Deep Dive into Disruptor and JNI Overheads
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.

BackendConfigurationHot Update
0 likes · 37 min read
Understanding Spring Boot Integration with Log4j2 and Logback: Logging Mechanisms, Configuration, and Hot Level Updates
Java Architect Essentials
Java Architect Essentials
Sep 26, 2024 · Backend Development

How Spring Boot Integrates Log4j2: Deep Dive into Logging Mechanics and Hot Updates

This article provides a comprehensive analysis of how Spring Boot 2.7.2 works with Log4j2 2.17.2, covering Log4j2's core components, Spring Boot's logging configuration options, the internal startup sequence, the LoggersEndpoint for runtime level changes, and custom hot‑update techniques, all illustrated with code snippets and diagrams.

ActuatorHot UpdateSpring Boot
0 likes · 38 min read
How Spring Boot Integrates Log4j2: Deep Dive into Logging Mechanics and Hot Updates
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.

JavaSpring Bootlog4j2
0 likes · 15 min read
Master Java Logging: Configure Logback & Log4j2 in Spring Boot
dbaplus Community
dbaplus Community
May 27, 2024 · Backend Development

How to Optimize Java Logging for Maximum Performance

This article explains why Java logging can become a performance bottleneck, identifies common misuse patterns, and provides practical steps—such as dynamic log levels, avoiding string concatenation, selective location info, and cautious async logging—to dramatically improve throughput and latency.

AsyncBackendJava
0 likes · 6 min read
How to Optimize Java Logging for Maximum Performance
Alibaba Cloud Developer
Alibaba Cloud Developer
Nov 27, 2023 · Backend Development

Boost Java Logging Performance: Practical Tips and Configurations

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.

AsyncJavalog4j2
0 likes · 20 min read
Boost Java Logging Performance: Practical Tips and Configurations
JD Cloud Developers
JD Cloud Developers
Oct 24, 2023 · Backend Development

How Switching to Async Log4j2 Can Double Your Application Throughput

This article analyzes a performance bottleneck caused by synchronous Log4j2 logging, demonstrates how converting to asynchronous logging with AsyncLogger or AsyncAppender dramatically reduces response time, increases TPS, and lowers CPU usage, and provides detailed configuration examples and best‑practice guidelines.

Performance Optimizationasynchronous logginglog4j2
0 likes · 17 min read
How Switching to Async Log4j2 Can Double Your Application Throughput
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.

FacadePatternJavalog4j2
0 likes · 22 min read
The Importance of Logging, Log Levels, and Common Java Logging Frameworks (Log4j, Logback, SLF4J)
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.

Performance Testinglog optimizationlog4j2
0 likes · 16 min read
Distributed System Log Printing Optimization and Performance Evaluation
dbaplus Community
dbaplus Community
Feb 7, 2023 · Backend Development

How We Cut Log4j2 Disk and CPU Usage by 90% in a High‑Traffic Shopping Cart

Facing massive log volume in JD.com’s shopping cart service, we reduced disk consumption, CPU load, and improved request latency by applying Log4j2 log level filtering, asynchronous logging with AsyncLogger, and TTL‑based thread‑local context propagation, while providing detailed metrics, configuration steps, and best‑practice recommendations.

Performance OptimizationTTLThreadLocal
0 likes · 14 min read
How We Cut Log4j2 Disk and CPU Usage by 90% in a High‑Traffic Shopping Cart
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
Meituan Technology Team
Meituan Technology Team
Jul 28, 2022 · Backend Development

Analyzing Log4j2 Thread Blocking Issues and Best Practices

The article examines how Log4j2’s AsyncAppender can block threads when its default 128‑entry queue fills, because creating LogEvent snapshots triggers ThrowableProxy parsing that loads reflective and lambda‑generated classes, causing class‑loader bottlenecks, and recommends custom async appenders, disabling reflection inflation, using synchronous loggers, and proper configuration to avoid these delays.

JavaReflectionasync appender
0 likes · 51 min read
Analyzing Log4j2 Thread Blocking Issues and Best Practices
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.

JavaRequest Loggingaop
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.

JavaResource OptimizationTTL
0 likes · 14 min read
Optimizing Log4j2 Logging: Reducing Disk and CPU Usage, Asynchronous Logging, and Traceability with ThreadLocal and TTL
Programmer DD
Programmer DD
Jan 10, 2022 · Information Security

Why the FTC Demands Immediate Log4j2 Fixes and How to Protect Your Data

The FTC urges companies to urgently patch Log4j2 (CVE‑2021‑44228) after a month of attacks by state‑backed hackers, warning of massive data leaks, financial loss, and potential lawsuits, while highlighting past cases like Equifax’s $700 million settlement.

CVE-2021-44228FTCinformation security
0 likes · 4 min read
Why the FTC Demands Immediate Log4j2 Fixes and How to Protect Your Data
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.

Patch UpgradeSecurity VulnerabilitySoftware Remediation
0 likes · 5 min read
Log4j2 Vulnerability and Logback Security: Remediation Recommendations
Programmer DD
Programmer DD
Dec 30, 2021 · Backend Development

Switch Spring Boot 2.x from Logback to Log4j2: Step‑by‑Step Guide

Learn how to replace Spring Boot 2.x's default Logback logging with the high‑performance Log4j2 by adding the starter dependency, configuring the logging file, and setting up a basic log4j2.xml, including code snippets and troubleshooting tips for a smooth migration.

JavaSpring BootTutorial
0 likes · 6 min read
Switch Spring Boot 2.x from Logback to Log4j2: Step‑by‑Step Guide
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.

JNDIJavaRemediation
0 likes · 7 min read
Understanding the Critical Log4j2 Vulnerability and Emergency Mitigation Measures
Programmer DD
Programmer DD
Dec 22, 2021 · Information Security

Why Was Alibaba Cloud Suspended for Six Months Over the Log4j2 Flaw?

The Chinese cybersecurity authority has suspended Alibaba Cloud’s partnership for six months after the company discovered a critical Log4j2 vulnerability but failed to promptly report it, highlighting gaps in vulnerability disclosure and threat‑management processes.

Alibaba CloudVulnerability Managementcybersecurity
0 likes · 2 min read
Why Was Alibaba Cloud Suspended for Six Months Over the Log4j2 Flaw?
Architecture Digest
Architecture Digest
Dec 21, 2021 · Information Security

Apache Log4j2 Remote Code Execution Vulnerability Exploitation Guide

This article introduces Apache Log4j2, explains the remote code execution vulnerability caused by unsafe JNDI lookups, provides step‑by‑step environment setup, PoC code, exploitation instructions, and outlines official patches and temporary mitigation measures for developers and security engineers.

ExploitJavaMitigation
0 likes · 5 min read
Apache Log4j2 Remote Code Execution Vulnerability Exploitation Guide
Programmer DD
Programmer DD
Dec 20, 2021 · Information Security

How to Safely Upgrade to Log4j2 2.17.0 and Mitigate CVE‑2021‑45105

Log4j2 2.17.0 fixes the critical CVE‑2021‑45105 vulnerability affecting versions up to 2.16.0, and the article explains the flaw, provides Maven upgrade instructions, and offers temporary mitigation steps for environments that cannot upgrade immediately.

CVE-2021-45105Java SecurityPatternLayout
0 likes · 4 min read
How to Safely Upgrade to Log4j2 2.17.0 and Mitigate CVE‑2021‑45105
Programmer DD
Programmer DD
Dec 19, 2021 · Information Security

How CodeQL and LGTM Uncovered a Log4j2 0‑Day: Inside the CWE‑074 Rule

Using LGTM’s online CodeQL scanner, the author demonstrates how a 2020 CWE‑074 rule can automatically detect a Log4j2 0‑day vulnerability, explains the rule’s data‑flow logic, and provides step‑by‑step instructions for scanning open‑source projects and responsibly handling discovered exploits.

CWE-074CodeQLLGTM
0 likes · 7 min read
How CodeQL and LGTM Uncovered a Log4j2 0‑Day: Inside the CWE‑074 Rule
JD Cloud Developers
JD Cloud Developers
Dec 16, 2021 · Information Security

Detect and Mitigate the Log4j2 Remote Code Execution Flaw with JD Cloud Tools

This article explains the critical Log4j2 remote code execution vulnerability, offers JD Cloud's free online scanning service, details rapid defense measures using Web Application Firewall and Starshield, and provides step‑by‑step mitigation and upgrade recommendations to protect Java applications.

MitigationVulnerabilityWeb Application Firewall
0 likes · 6 min read
Detect and Mitigate the Log4j2 Remote Code Execution Flaw with JD Cloud Tools
Alibaba Cloud Native
Alibaba Cloud Native
Dec 16, 2021 · Information Security

Why RASP Outperforms Traffic‑Based Defenses Against Log4j2 Exploits

The Log4j2 remote code execution flaw is hard to contain because it enables arbitrary code execution and hides its traffic signatures, but Runtime Application Self‑Protection (RASP) can detect malicious behavior at the application level, offering low false‑positives and automatic component discovery without relying on constantly updated rules.

Cloud NativeJavaRASP
0 likes · 9 min read
Why RASP Outperforms Traffic‑Based Defenses Against Log4j2 Exploits
Aikesheng Open Source Community
Aikesheng Open Source Community
Dec 15, 2021 · Information Security

How to Patch the Apache Log4j2 Vulnerability in Dble

This guide explains four remediation methods for the Log4j2 security flaw in Dble, including upgrading to Log4j2 2.16.0, adding a configuration property, adjusting JVM parameters for older versions, and setting a system environment variable, with detailed step‑by‑step instructions and code snippets.

JavaSecurity Patchlog4j2
0 likes · 6 min read
How to Patch the Apache Log4j2 Vulnerability in Dble
Alibaba Cloud Native
Alibaba Cloud Native
Dec 13, 2021 · Information Security

How to Block Log4j2 RCE Attacks in Four Simple Steps with Alibaba Cloud ARMS

The article explains the massive impact of the Log4j2 remote code execution vulnerability, details why its JNDI lookup is easily exploitable, lists affected software, and provides a concise four‑step guide using Alibaba Cloud ARMS RASP to detect, monitor, and block attacks while offering remediation recommendations.

ARMSCloud NativeRASP
0 likes · 6 min read
How to Block Log4j2 RCE Attacks in Four Simple Steps with Alibaba Cloud ARMS
Senior Brother's Insights
Senior Brother's Insights
Dec 12, 2021 · Information Security

Unveiling JNDI: From Basics to Real‑World Log4j2 Exploit with RMI

This article explains the fundamentals of Java Naming and Directory Interface (JNDI), its architecture and typical usage, then walks through a step‑by‑step RMI implementation and demonstrates how JNDI can be abused to craft a Log4j2 remote code execution attack, complete with full code samples and mitigation advice.

ExploitJNDIJava
0 likes · 20 min read
Unveiling JNDI: From Basics to Real‑World Log4j2 Exploit with RMI
macrozheng
macrozheng
Dec 12, 2021 · Information Security

Unpacking the Log4j2 Log4Shell Vulnerability: How JNDI Injection Works

This article breaks down the widely publicized Log4j2 (Log4Shell) flaw, explaining the underlying JNDI and LDAP lookup mechanisms, how malicious payloads are executed through log messages, the massive impact across Java ecosystems, and the steps needed to remediate the issue.

JNDI injectionJava SecurityRemote Code Execution
0 likes · 10 min read
Unpacking the Log4j2 Log4Shell Vulnerability: How JNDI Injection Works
Java Architect Essentials
Java Architect Essentials
Dec 10, 2021 · Information Security

Mitigating the Critical Apache Log4j2 Vulnerability (CVE‑2021‑44228)

The article explains the severe Log4j2 remote‑code‑execution vulnerability affecting versions 2.0 to 2.14.1, provides the official patch link, and lists practical temporary mitigation steps such as JVM flags, configuration changes, environment variables, and network isolation to protect Java applications.

CVE-2021-44228JavaMitigation
0 likes · 3 min read
Mitigating the Critical Apache Log4j2 Vulnerability (CVE‑2021‑44228)
MaGe Linux Operations
MaGe Linux Operations
Dec 10, 2021 · Information Security

How the Log4j2 RCE Flaw Threatened Global Systems and What to Do Now

A critical remote code execution vulnerability in Apache Log4j2, exposed through JNDI injection, has impacted major services worldwide, prompting urgent patches, temporary mitigations, and ongoing updates from the Apache project to protect vulnerable Java applications.

JavaRemote Code ExecutionSecurity Vulnerability
0 likes · 6 min read
How the Log4j2 RCE Flaw Threatened Global Systems and What to Do Now
ITPUB
ITPUB
Dec 10, 2021 · Information Security

Why the Log4j2 RCE Bug Is a Global Threat and How to Fix It

The Log4j2 remote code execution vulnerability (CVE‑2021‑44228, CNVD‑2021‑95914) affects all Java‑based applications from version 2.0 to 2.15.0‑rc1, allowing unauthenticated attackers to execute arbitrary code, and requires immediate inventory, patching, and hardening measures across all affected systems.

JavaRCEVulnerability Management
0 likes · 6 min read
Why the Log4j2 RCE Bug Is a Global Threat and How to Fix It
Java Architect Essentials
Java Architect Essentials
Nov 21, 2021 · Backend Development

Comprehensive Guide to Apache Log4j2: Features, Performance, Configuration, and Usage

This article provides an in‑depth overview of Apache Log4j2, comparing it with Logback and Log4j 1, highlighting its superior asynchronous performance, zero‑GC operation, flexible configuration formats, rich appender ecosystem, and practical code examples for Maven integration, XML setup, and advanced logging techniques.

BackendJavalog4j2
0 likes · 11 min read
Comprehensive Guide to Apache Log4j2: Features, Performance, Configuration, and Usage
Top Architect
Top Architect
Sep 16, 2021 · Backend Development

Building a Log Collection and Visualization Pipeline with SpringBoot, Log4j2, Kafka, Filebeat, Logstash, Elasticsearch, and Kibana

This tutorial walks through the end‑to‑end setup of a logging pipeline that starts with a SpringBoot application using Log4j2, forwards logs to Kafka, collects them with Filebeat, processes them via Logstash, and finally visualizes them in Elasticsearch and Kibana, covering server preparation, configuration files, and essential code snippets.

ElasticsearchFilebeatKafka
0 likes · 17 min read
Building a Log Collection and Visualization Pipeline with SpringBoot, Log4j2, Kafka, Filebeat, Logstash, Elasticsearch, and Kibana
Code Ape Tech Column
Code Ape Tech Column
Sep 3, 2021 · Backend Development

Data Desensitization Techniques for Configuration Files, API Responses, and Log Files in Spring Boot

This article explains how to protect sensitive information in Spring Boot applications by encrypting configuration files with jasypt‑spring‑boot, masking API response fields using a custom Jackson annotation, and filtering log output with a custom Log4j2 PatternLayout, providing complete code examples for each method.

JacksonJasyptSpring Boot
0 likes · 16 min read
Data Desensitization Techniques for Configuration Files, API Responses, and Log Files in Spring Boot
Code Ape Tech Column
Code Ape Tech Column
Jul 31, 2021 · Backend Development

Understanding Log4j2 RollingFileAppender: Configuration, Policies, and Strategies

This article explains how Log4j2's RollingFileAppender works, covering the concepts of rollover, the various TriggeringPolicy options, DefaultRolloverStrategy behavior, DeleteAction configuration, and provides sample XML configurations and a Java demo to illustrate time‑based, size‑based, and composite rollover scenarios.

ConfigurationJavaRollingFile
0 likes · 13 min read
Understanding Log4j2 RollingFileAppender: Configuration, Policies, and Strategies
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Jul 14, 2021 · Backend Development

Mastering SLF4J MDC for Precise Log Tracing in Multi‑Threaded Java Applications

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.

ThreadLocallog4j2mdc
0 likes · 4 min read
Mastering SLF4J MDC for Precise Log Tracing in Multi‑Threaded Java Applications
Selected Java Interview Questions
Selected Java Interview Questions
Jun 10, 2021 · Backend Development

Understanding Log4j2 RollingFile Appender: TriggeringPolicy, RolloverStrategy, and DeleteAction

This article explains how Log4j2's RollingFileAppender works, covering the roles of TriggeringPolicy and RolloverStrategy, showing various filePattern configurations, detailing the DefaultRolloverStrategy max parameter, introducing DeleteAction for custom file cleanup, and providing Java demo code and test configurations.

DeleteActionJavaRollingFile
0 likes · 15 min read
Understanding Log4j2 RollingFile Appender: TriggeringPolicy, RolloverStrategy, and DeleteAction
Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Apr 22, 2021 · Backend Development

Prevent Log Injection in Log4j2: Clean Input, PatternLayout, and Custom Throwable Converter

This article explains how malicious newline characters in logged usernames can cause log injection, demonstrates a simple input‑sanitizing method, shows how to use Log4j2's %enc{%m}{CRLF} pattern and a custom ThrowablePatternConverter to ensure all log messages and exception stacks remain on a single safe line.

Exception HandlingSecuritylog injection
0 likes · 8 min read
Prevent Log Injection in Log4j2: Clean Input, PatternLayout, and Custom Throwable Converter
Programmer DD
Programmer DD
Apr 18, 2021 · Backend Development

Why Log4j2 Beats Logback: Performance, Zero‑GC, and Advanced Features

Log4j2, the modern successor to Logback and Log4j 1, offers dramatically superior asynchronous performance, zero‑GC operation, flexible configuration formats, powerful parameter formatting, lazy logging via lambdas, and extensive appender support, making it the top choice for Java logging in high‑throughput applications.

asynchronous loggingjava logginglazy logging
0 likes · 11 min read
Why Log4j2 Beats Logback: Performance, Zero‑GC, and Advanced Features
Code Ape Tech Column
Code Ape Tech Column
Apr 16, 2021 · Backend Development

Why Log4j2 Beats Logback and Log4j1: Performance, Configuration, and Advanced Features

This article compares Log4j2 with older Java logging frameworks, highlighting its superior asynchronous performance, zero‑GC design, flexible parameter formatting, simplified configuration options, and practical usage examples, ultimately showing why it should replace Logback and Log4j1 in modern applications.

ConfigurationLazy Evaluationasync logging
0 likes · 14 min read
Why Log4j2 Beats Logback and Log4j1: Performance, Configuration, and Advanced Features
FunTester
FunTester
Mar 31, 2021 · Backend Development

Resolving Slow Java Application Startup on macOS Caused by a JDK getLocalHost Bug

The article describes a macOS JDK bug where calls to java.net.InetAddress.getLocalHost() cause a 5‑second (or longer) delay during application startup, explains the investigation steps, and provides three practical fixes including hosts file modification, interface aliasing, and JDK upgrade.

Java bugNetwork Configurationlog4j2
0 likes · 7 min read
Resolving Slow Java Application Startup on macOS Caused by a JDK getLocalHost Bug
Zhuanzhuan Tech
Zhuanzhuan Tech
Mar 3, 2021 · Backend Development

Separating Middleware Logs with Programmatic Log4j2 Configuration in Java

This article describes how to programmatically configure Log4j2's LoggerContext to separate middleware logs into dedicated files, encapsulate the setup in a shared jar, expose a logger retrieval API, and integrate it into middleware components, reducing business log interference and storage costs.

BackendConfigurationJava
0 likes · 8 min read
Separating Middleware Logs with Programmatic Log4j2 Configuration in Java
Architecture Digest
Architecture Digest
Oct 19, 2020 · Backend Development

Performance Comparison of Logback and Log4j2 Synchronous vs Asynchronous Logging

This article revisits a previous logback configuration test, expands the sample size and repeats the measurements using JMeter, JProfile, and New Relic APM to compare synchronous and asynchronous logging in Logback and Log4j2, revealing that asynchronous logging reduces log latency but only marginally improves overall TPS, while Log4j2’s async implementation can boost TPS up to six times.

JavaPerformance Testingasynchronous logging
0 likes · 8 min read
Performance Comparison of Logback and Log4j2 Synchronous vs Asynchronous Logging
Code Ape Tech Column
Code Ape Tech Column
Sep 29, 2020 · Backend Development

How to Switch Logging Frameworks in Spring Boot Using SLF4J

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.

BackendJavaSpring Boot
0 likes · 11 min read
How to Switch Logging Frameworks in Spring Boot Using SLF4J
Java Backend Technology
Java Backend Technology
Aug 13, 2020 · Backend Development

Why Asynchronous Logging Doesn’t Boost TPS – Real Test Results with Logback and Log4j2

Through extensive JMeter and APM testing on a 6‑core, 8 GB server, this article reveals that switching Logback from synchronous to asynchronous logging yields minimal TPS improvement, explains why, and demonstrates that Log4j2’s async implementation can achieve up to six‑fold performance gains.

JavaPerformance Testingasynchronous logging
0 likes · 8 min read
Why Asynchronous Logging Doesn’t Boost TPS – Real Test Results with Logback and Log4j2
FunTester
FunTester
Apr 27, 2020 · Backend Development

Dynamically Adjust Log Levels with Arthas Logger and Log4j2

This guide explains how to use the Arthas logger command to change Java logger levels on‑the‑fly without restarting the JVM, demonstrates a complete Log4j2 XML configuration, and provides a runnable Java example that continuously emits logs at various levels.

ArthasDynamic Log LevelJava
0 likes · 7 min read
Dynamically Adjust Log Levels with Arthas Logger and Log4j2
Yanxuan Tech Team
Yanxuan Tech Team
Mar 9, 2020 · Fundamentals

Mastering Java ClassLoaders: Core APIs, Parent Delegation, and Agent Isolation

This article explains what a Java ClassLoader is, details its core APIs such as defineClass, findClass, loadClass, and findResource, describes the parent‑delegation model, and demonstrates how custom ClassLoaders can be used for class isolation in Java agents, illustrated with real‑world log4j2 pitfalls and solutions.

Class IsolationJavaJava Agent
0 likes · 15 min read
Mastering Java ClassLoaders: Core APIs, Parent Delegation, and Agent Isolation
Efficient Ops
Efficient Ops
Apr 9, 2019 · Backend Development

Why Is My Java Service Stalling? Uncovering GC, Safepoint, and Log4j2 Bottlenecks

After weeks of investigation, this post details how intermittent request timeouts in a high‑concurrency Java service were traced to frequent JVM stop‑the‑world pauses caused by GC, safepoint logging, biased lock revocation, and Log4j2’s synchronous logging, and outlines the steps taken to diagnose and resolve the issue.

BTraceJavaSafepoint
0 likes · 10 min read
Why Is My Java Service Stalling? Uncovering GC, Safepoint, and Log4j2 Bottlenecks
Java Architecture Diary
Java Architecture Diary
Mar 8, 2019 · Backend Development

Boost Java Spring Boot Performance with Mica-Log4j2’s Asynchronous Logging

This guide explains how Mica-Log4j2 provides environment‑specific log configurations, high‑throughput asynchronous logging via Disruptor, replaces System.out/err in non‑dev modes, and shows Maven/Gradle dependencies, system settings, custom log levels, file structures, and open‑source resources for Spring Boot applications.

AsynchronousJavaSpring Boot
0 likes · 3 min read
Boost Java Spring Boot Performance with Mica-Log4j2’s Asynchronous Logging
Programmer DD
Programmer DD
Dec 2, 2018 · Backend Development

Why Log4j2 Beats Logback: Real‑World Performance Test and Disruptor Secrets

An in‑depth performance comparison of Logback and Log4j2 shows how asynchronous logging and the Disruptor queue dramatically improve throughput, with benchmark data across various hardware, configuration tips, and a look at underlying queue implementations such as ArrayBlockingQueue versus Disruptor.

Disruptorasynchronous logginglog4j2
0 likes · 8 min read
Why Log4j2 Beats Logback: Real‑World Performance Test and Disruptor Secrets