LearnThatStack Ace your next interview
Observability & Monitoring · question
Q.04 of 27

What are the different log levels and when should you use each?

beginner
← All Observability & Monitoring questions
Re-explain

Standard log levels in order of severity:
TRACE: Finest level of detail, typically for debugging specific code paths

TRACE: Entering method calculateTax() with amount=100.50

DEBUG: Detailed information for debugging, not for production

DEBUG: Database query: SELECT * FROM users WHERE id = 123

INFO: General information about application flow

INFO: User 123 successfully logged in

WARN: Indicates a potential issue that doesn't stop the application

WARN: API rate limit approaching: 950/1000 requests used

ERROR: Error conditions that don't stop the application

ERROR: Failed to send email notification: SMTP timeout

FATAL: Severe errors that may cause the application to terminate

FATAL: Cannot connect to database, shutting down

Best practices:

  • Use INFO for business events and milestones
  • Use WARN for recoverable errors and degraded states
  • Use ERROR for actual failures that need attention
  • Use DEBUG/TRACE only in development (performance impact)
  • Be consistent across your organization
  • Include context (user ID, request ID, session ID)
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

Saved in this browser - sign in to keep your review list.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Interview lens

Likely follow-ups, what you can say, and the weak answers to avoid.

Sign in free to open it Free account - the lens opens as soon as you're back.

Want a quick review of the fundamentals? See the Observability & Monitoring cheatsheet.

← Back to all Observability & Monitoring questions
Pro · $10/mo

23 of 27 Observability & Monitoring answers are gated.

Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.

  • Full answers + code
  • AI explain - simpler, deeper, or visualized
  • 1,000 AI credits / month
  • Cancel anytime