📋
Auto-Configuration

Debugging with the Conditions Report

--debug Flag Deep Dive
💡 Conditions Evaluation Report ek X-RAY MACHINE hai application STARTUP ka — NORMALLY, application "BLACK BOX" ki tarah START hoti hai (kya HUA, PATA nahi). --debug flag se, HAR SINGLE DECISION (kya APPLY hui, kya SKIP hui, aur KYUN) VISIBLE ho jaata hai.

Jab EK EXPECTED bean CREATE nahi hoती (jaise "DataSource bean MISSING" error), --debug flag SABSE POWERFUL DEBUGGING TOOL hai. Application ko java -jar app.jar --debug se RUN karो — OUTPUT mein "CONDITIONS EVALUATION REPORT" milता hai, JO EXACTLY BATATA hai KAUN SI auto-configuration APPLY hui, aur KAUN SI SKIP hui, aur KYUN.

REPORT DO SECTIONS mein hai — "POSITIVE MATCHES" (successfully APPLIED configurations) aur "NEGATIVE MATCHES" (SKIPPED configurations, saath mein EXACT REASON — jaise "required class NAHI mili classpath par", ya "EK EXISTING bean ALREADY PRESENT hai").

java -jar myapp.jar --debug

# Output (partial example):
# =========================
# CONDITIONS EVALUATION REPORT
# =========================
# Positive matches:
# -----------------
#    DataSourceAutoConfiguration matched:
#       - @ConditionalOnClass found required class 'javax.sql.DataSource'
#
# Negative matches:
# -----------------
#    RedisAutoConfiguration:
#       Did not match:
#          - @ConditionalOnClass did not find required class 'redis.clients.jedis.Jedis'
📋
Conditions Evaluation Report ek X-RAY MACHINE hai application STARTUP ka — NORMALLY, application "BLACK BOX" ki tarah START hoti hai (kya HUA, PATA nahi). --debug flag se, HAR SINGLE DECISION (kya APPLY hui, kya SKIP hui, aur KYUN) VISIBLE ho jaata hai.
1 / 6
⚡ झट से Recap
  • --debug flag = poori startup mein KYA decide hua, DETAILED report
  • Positive matches = APPLIED auto-configurations
  • Negative matches = SKIPPED, EXACT reason ke saath
इस page में (2 subtopics)

--debug flag ka OUTPUT DO SECTIONS mein hota hai — "POSITIVE MATCHES" (jo auto-configurations APPLY hui, aur KYUN) aur "NEGATIVE MATCHES" (jo SKIP hui, aur KYUN NAHI). Ye REPORT SABSE POWERFUL DEBUGGING TOOL hai jab "MERI EXPECTED bean CREATE nahi ho rahi" jaisi PROBLEM aaye.

java -jar app.jar --debug

# Negative matches mein dikhega, jaise:
# DataSourceAutoConfiguration:
#   Did not match:
#      - @ConditionalOnClass did not find required class 'javax.sql.DataSource'

Actuator ka /actuator/conditions endpoint (agar EXPOSED hai) YAHI REPORT, RUNTIME mein, HTTP endpoint ke through DETA hai — production/staging environments mein DEBUG karने ke liye USEFUL, jaha application ko --debug flag ke saath RESTART karna PRACTICAL NAHI hota.

  • --debug flag = startup-time report, console mein
  • /actuator/conditions = runtime report, HTTP endpoint ke through