easy

Design a Logger System

Design a logging framework that supports multiple log levels (DEBUG, INFO, WARN, ERROR) and multiple output destinations (console, file). Include log formatting and filtering by severity.

Suggested time: 45 minutes

Loading the workspace...

About this problem

A logger seems like a utility class with a print statement. But a production logger must support multiple severity levels, route messages to multiple destinations simultaneously, format entries consistently, allow runtime configuration changes, and handle concurrent writes from dozens of threads without interleaving or losing entries. The design challenge is building a system where adding a new output destination requires zero changes to existing code.

What your design needs to cover

  • Multi-Level Logging

  • Multiple Output Destinations

  • Formatted Log Messages

  • Runtime Level Configuration

Key challenges the editorial covers

Learn from other designs

Related problems

Guides