research if we should be using loggers in our backend. #856

Closed
opened 2026-05-08 14:59:26 +00:00 by a22erigr · 3 comments
Collaborator

Description

At the moment our logging is just random Console.WriteLines. It gets the job done but it is far from optimal. After some basic searching i found something called Logging .

What should be done

  • We should look in to this
  • Should we us this in our application
  • What alternatives exists.
  • If we should start using them give a recommendation.
## Description At the moment our logging is just random Console.WriteLines. It gets the job done but it is far from optimal. After some basic searching i found something called [Logging ](https://learn.microsoft.com/en-us/dotnet/core/extensions/logging/overview?tabs=command-line). ## What should be done + We should look in to this + Should we us this in our application + What alternatives exists. + If we should start using them give a recommendation.
Collaborator

Should we use this in our application?

In my opinion, yes:
ILogger is a high-performance, structured logging API to help monitor application behavior and diagnose issues. Its basic logging providers are already built-in to ASP.NET Core
ILogger is better for debugging since it adds structure and control to logging
Advantages over Console.WriteLine. ILogger can:

  • Structure logs
  • Support information, Warning, Error, Debug, etc.
  • Easy to filter
  • Logs can show which service/class created them
  • Consistent formatting
  • Designed for production apps
  • connect to files, databases, and dashboards.

Pros:

  • already included
  • easy to use
  • supports log levels
  • works well with Docker
  • Can integrate with other logging libraries later

(Recommended)

Another alternative is Serilog

It is modern. Net logging library designed for structured logging and built with powerful structured event data.

Pros:

  • structured logs
  • beautiful console logs
  • file logging
  • excellent Docker support

Cons:

  • More setup

Recommendation

For this current application, the best choice is to replace the Console.Writeline with ILogger system.
Using this logging framework will provide more structured and easier to read logs. It will make filtering and debugging easier.
It can separate into different levels (Information, Warning, and Error), which makes it much easier to find important issues.
It also allows us to identify which class generated a log message.
There is a better alternative, such as Serilog. However, in my personal opinion, Serilog is unnecessary and too advanced for this project. It can still be integrated later on.

## Should we use this in our application? In my opinion, yes: **_ILogger_** is a high-performance, structured logging API to help monitor application behavior and diagnose issues. Its basic logging providers are already built-in to ASP.NET Core **_ILogger_** is better for debugging since it adds structure and control to logging Advantages over Console.WriteLine. ILogger can: - Structure logs - Support information, Warning, Error, Debug, etc. - Easy to filter - Logs can show which service/class created them - Consistent formatting - Designed for production apps - connect to files, databases, and dashboards. ### Pros: - already included - easy to use - supports log levels - works well with Docker - Can integrate with other logging libraries later **(Recommended)** ## Another alternative is **_Serilog_** It is modern. Net logging library designed for structured logging and built with powerful structured event data. ### Pros: - structured logs - beautiful console logs - file logging - excellent Docker support ### Cons: - More setup ## Recommendation For this current application, the best choice is to replace the Console.Writeline with ILogger system. Using this logging framework will provide more structured and easier to read logs. It will make filtering and debugging easier. It can separate into different levels (Information, Warning, and Error), which makes it much easier to find important issues. It also allows us to identify which class generated a log message. There is a better alternative, such as Serilog. However, in my personal opinion, Serilog is unnecessary and too advanced for this project. It can still be integrated later on.
Collaborator

Review

What did i review?

Issue focus

  • The issue is focused on this being exclusively a research issue, and should probably spawn sub issues for implementation

  • The issue seems reasonable and good for future debugging

Issue resolving

  • Good arguments with pros/cons
  • Good comparison between different options
  • Easy to follow
  • Overall, seems reasonable.

NOTE

We have been notified earlier that all decision making introducing dependencies to the project should be documented precisely to help subsequent developers understand why they exist. I will note the leader regarding this issue to see if any further work needs to be done in regards to this aspect.

# Review ## What did i review? ### Issue focus - The issue is focused on this being exclusively a research issue, and should probably spawn sub issues for implementation - The issue seems reasonable and good for future debugging ### Issue resolving - Good arguments with pros/cons - Good comparison between different options - Easy to follow - Overall, seems reasonable. ## NOTE ### We have been notified earlier that all decision making introducing dependencies to the project should be documented precisely to help subsequent developers understand why they exist. I will note the leader regarding this issue to see if any further work needs to be done in regards to this aspect.
Author
Collaborator

ILogger is a high-performance, structured logging API to help monitor application behavior and diagnose issues. Its basic logging providers are already built-in to ASP.NET Core
Barbecue of this ILogger is going to be used

_ILogger is a high-performance, structured logging API to help monitor application behavior and diagnose issues. Its basic **logging providers are already built-in to ASP.NET Core**_ Barbecue of this ILogger is going to be used
Sign in to join this conversation.
No milestone
No project
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K#856
No description provided.