# Logging Exceptions in C#

Logging Exceptions in C#: Logging Exceptions in C#: an overview, Creating the LogService, Writing Log Entries.

Updated: November 3, 2026

1. [Logging Exceptions in C#: an overview](https://www.ask-codey.com/lessons/logging-exceptions-in-csharp-an-overview) (Journeyman): A log is a file of time-stamped lines recording what an app did and what went wrong, so you can find out later. Apps log to plain text files because they're fast, simple, and keep working when everything else fails.
2. [Creating the LogService](https://www.ask-codey.com/lessons/logging-exceptions-in-csharp-creating-the-logservice) (Journeyman): Build a LogService that appends one time-stamped line per entry to a file named for the day, such as logs\\errors\\20260314.log. It asks for an IClock so tests can choose the date, and it never lets a logging problem crash the app.
3. [Writing Log Entries](https://www.ask-codey.com/lessons/logging-exceptions-in-csharp-writing-log-entries) (Journeyman): Create one LogService for errors and one for ordinary events, each with its own folder. In a catch block, log the exception's type and message with the file or record involved, and tell the user something helpful.

Source: https://www.ask-codey.com/courses/csharp-full-stack-bootcamp/topics/logging-exceptions-in-csharp
