umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.4k stars 2.66k forks source link

Some files in the Umbraco-CMS project don't use Serilog style logging #15591

Closed liamlaverty closed 7 months ago

liamlaverty commented 7 months ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.x.x

Bug summary

A few files in Umbraco-CMS don't follow the serilog logging style conventions:

https://docs.umbraco.com/umbraco-cms/fundamentals/code/debugging/logging

Specifics

https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Infrastructure/Migrations/MigrationPlanExecutor.cs

https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Web.BackOffice/Controllers/ExamineManagementController.cs

https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Web.BackOffice/Controllers/HelpController.cs

https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Web.Common/Middleware/PreviewAuthenticationMiddleware.cs

Steps to reproduce

In ExamineManagementController.cs, scroll to line 309

In HelpController.cs, scroll to line 69

In PreviewAuthenticationMiddleware.cs, scroll to line 78

In MigrationPlanExecutor.cs, scroll to line 130

Expected result / actual result

Logging strings should follow the documentation convention:

//GOOD - Do use :)
_logger.LogInformation("We are saying hello to {Name}", name);

//BAD - Do not use :(
_logger.LogInformation($"We are saying hello to {name}");

//BAD - Do not use :(
_logger.LogInformation("We are saying hello to " + name);
github-actions[bot] commented 7 months ago

Hi there @liamlaverty!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

andr317c commented 7 months ago

Hey! Good catch, you are certainly right. 😄 Thanks for also creating a PR!

mikecp commented 7 months ago

Closed as per merge of the PR 👍