Add log4j2-levels module: threshold rule, inheritance, additivity, custom levels, Actuator runtime changes and argument evaluation on Spring Boot 4.1.2 / Log4j2 2.25.5, with real transcripts

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b5SFkZoaMCukJNvZCV
This commit is contained in:
asmhatre
2026-11-17 23:20:53 +05:30
co-authored by Claude Sonnet 5.5
parent fe3fc689a6
commit c9a2b766bb
44 changed files with 1508 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
# service package at DEBUG (what log4j2-spring.xml configures); db package stays at ERROR
DEBUG c.a.l.s.UserService - Entering getUserById with userId: 1
INFO c.a.l.s.UserService - Fetching user with ID: 1
DEBUG c.a.l.s.UserService - Successfully retrieved user: asha
DEBUG c.a.l.s.UserService - Entering getUserById with userId: 99
INFO c.a.l.s.UserService - Fetching user with ID: 99
INFO c.a.l.s.UserService - User not found for ID: 99
DEBUG c.a.l.s.UserService - Entering getUserById with userId: null
WARN c.a.l.s.UserService - getUserById called with null userId
DEBUG c.a.l.s.UserService - Entering getUserById with userId: -1
INFO c.a.l.s.UserService - Fetching user with ID: -1
ERROR c.a.l.d.UserRepository - connection reset while loading user -1
ERROR c.a.l.s.UserService - Database error while fetching user with ID: -1
com.ankurm.log4j2levels.db.DatabaseException: connection reset
at com.ankurm.log4j2levels.db.UserRepository.findById(UserRepository.java:24)
INFO c.a.l.s.UserService - Starting batch user processing
DEBUG c.a.l.s.UserService - Processed 2 users in batch
INFO c.a.l.s.UserService - Batch processing completed, 2 processed
INFO c.a.l.s.UserService - Starting batch user processing
ERROR c.a.l.d.UserRepository - connection reset while loading user -1
FATAL c.a.l.s.UserService - Critical failure in batch processing, giving up.
com.ankurm.log4j2levels.db.DatabaseException: connection reset
at com.ankurm.log4j2levels.db.UserRepository.findById(UserRepository.java:24)
INFO c.a.l.s.UserService - Batch processing completed, 1 processed
lines: 23
# the same calls with the service package raised to INFO
INFO c.a.l.s.UserService - Fetching user with ID: 1
INFO c.a.l.s.UserService - Fetching user with ID: 99
INFO c.a.l.s.UserService - User not found for ID: 99
WARN c.a.l.s.UserService - getUserById called with null userId
INFO c.a.l.s.UserService - Fetching user with ID: -1
ERROR c.a.l.d.UserRepository - connection reset while loading user -1
ERROR c.a.l.s.UserService - Database error while fetching user with ID: -1
com.ankurm.log4j2levels.db.DatabaseException: connection reset
at com.ankurm.log4j2levels.db.UserRepository.findById(UserRepository.java:24)
INFO c.a.l.s.UserService - Starting batch user processing
INFO c.a.l.s.UserService - Batch processing completed, 2 processed
INFO c.a.l.s.UserService - Starting batch user processing
ERROR c.a.l.d.UserRepository - connection reset while loading user -1
FATAL c.a.l.s.UserService - Critical failure in batch processing, giving up.
com.ankurm.log4j2levels.db.DatabaseException: connection reset
at com.ankurm.log4j2levels.db.UserRepository.findById(UserRepository.java:24)
INFO c.a.l.s.UserService - Batch processing completed, 1 processed
lines: 17