You are doing logging in .NET wrong. Let’s fix it - Nick Chapsas - Copenhagen DevFest 2023

2023 ж. 2 Қаз.
12 793 Рет қаралды

Speaker: @nickchapsas Logging is a vital part of every application that runs in production. It is in place to tell a story about the lifecycle of its runtime and make it easy for developers to debug a system and identify what failed and how when things go wrong. It is, however, extremely easy to get it wrong, and the problems caused can stay hidden for years. In this session, I will talk you through all the possible issues that logging can cause and show you how you can fix every single one of them.

Пікірлер
  • Nice to hear Nick talk at close to human normal speed 😊

    @StephenJWalter@StephenJWalter7 ай бұрын
    • I put it on 2x to normalize.

      @PelFox@PelFox7 ай бұрын
  • I have yet to witness an application where boxing/unboxing and/or string allocation is the biggest problem. Been doing it for 15years

    @kudorgyozo@kudorgyozo7 ай бұрын
    • 25 years here, same story.

      @andersborum9267@andersborum92677 ай бұрын
    • This. Premature optimisation. I'll start worrying about this level of logging optimisation if I have a quantitative latency problem at hand. So far it hasn't happened to me.

      @ernest1520@ernest15207 ай бұрын
    • I hit that wall 2 years in my career and I had to keep it in mind always for the following 4. It's all contextual, but mentioned in the talk, the performance is a happy accident of doing it right, not the reason to do it right. The reason to do it right is that you end up with the correct details captured properly so you can debug your system reliably.

      @nickchapsas@nickchapsas7 ай бұрын
    • @@nickchapsasjust to be clear, it's definitely something a developer should always look out for, but I guess some of us "older" developers are so experienced / have proper knowledge of the CLR etc. that our implementations by default are pretty decent in terms of allocations. Always measure if in doubt.

      @andersborum9267@andersborum92677 ай бұрын
    • I agree. In 99,9% of the applications I make, 99,9% of time is spent waiting for something (database, API, ...). The resource usage of the application itself is never a factor. Disclaimer - I build business applications and API's, and not million concurrent user scale ones. By no means are they all simple CRUD's. Some have extremely complex business logic. Still I can CPU process millions of rules in the time it takes to get a response from a single external API call. I've seen examples where logging was causing performance issues, but it was because of how it did I/O. The C# code itself was irrelevant. I think Nick might have had different personal experience, because he worked at a company creating a massively used service. The problem is that that's a very rare thing. The overwhelming majority of .NET developers don't face any of those issues. Low level performance is irrelevant for them. On the contrary I can see business massively migrating into the low-code/no-code platforms, which is the complete opposite of performant and maintainable code. It's an interesting talk either way and the presentation is very good. Although I treat it more like a form of code riddles, than something applicable in the real world. BTW - I use GCP in a few projects :) It's cheap and blazing fast compared to Azure and especially AWS (in the same price range). I think part of it is the fact that the datacenters are simply newer, and there is a difference between 10 and 2 year old hardware.

      @mekowgli@mekowgli6 ай бұрын
  • Nice talk, but I really hoped for more insight in regards to what to log to benefit later.

    @LunicLynx@LunicLynx7 ай бұрын
  • Εξαιρετική ομιλία Νίκο! Το τέλειο balance μεταξύ χιούμορ και χρήσιμης πληροφορίας!

    @panosru@panosru4 ай бұрын
  • For once I agree with you on something. There is no such thing as premature optimization and you should think about the structure of your code from the start so you don't wind up painting yourself into a corner. As far as logging is concerned, allocate a buffer that lives as long as the application does and overwrite it for each log event. If you need threaded logging, then allocate that buffer per thread, and if your threads are short-lived then allocate a pool of buffers and cycle them.

    @anon_y_mousse@anon_y_mousse6 ай бұрын
  • I stopped watching his videos precisely because of the clickbait titles. Funny hearing him talking about that. Also, this is first time I'm seeing so many ads in a NDC talk.

    @user-tj9gj2wx5d@user-tj9gj2wx5d7 ай бұрын
    • Exactly! "Watching Nick Chapsas? You're doing it wrong!"

      @SBDavin@SBDavin7 ай бұрын
    • he has good content, it's what should matter...

      @igelineau@igelineau7 ай бұрын
    • I am less happy about almost two minute add for his courses in every recent video, titles don't bother me. Just skip to minute 3 and you know whether you are interested :D

      @Qrzychu92@Qrzychu927 ай бұрын
  • Even his bad KZhead videos provide more information than this horrible talk.

    @christian123542@christian1235425 ай бұрын
  • Meh..... Can't wait to not watch NC

    @OeHomestead@OeHomestead7 ай бұрын
    • Why click then?

      @benbrist@benbrist7 ай бұрын
KZhead