Mid From PDF Power Questions High-Impact Interview Questions

Scalable Logging Framework?

public interface ILoggerTarget
{

void Log(string message);

}

Central Logger

public class Logger
{
private readonly List<ILoggerTarget> targets = new();
public void AddTarget(ILoggerTarget target)
=> targets.Add(target);
public void Log(string message)
{
foreach (var t in targets)

t.Log(message);

}
}

Supports:

  • Console
  • File
  • Database
  • Cloud

Follows Open–Closed Principle.

More from Career Preparation

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details