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

Sdílet
Vložit
  • čas přidán 2. 10. 2023
  • 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.
  • Věda a technologie

Komentáře • 19

  • @StephenJWalter
    @StephenJWalter Před 8 měsíci +27

    Nice to hear Nick talk at close to human normal speed 😊

    • @PelFox
      @PelFox Před 7 měsíci +5

      I put it on 2x to normalize.

  • @kudorgyozo
    @kudorgyozo Před 8 měsíci +16

    I have yet to witness an application where boxing/unboxing and/or string allocation is the biggest problem. Been doing it for 15years

    • @andersborum9267
      @andersborum9267 Před 8 měsíci +1

      25 years here, same story.

    • @ernest1520
      @ernest1520 Před 8 měsíci +2

      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.

    • @nickchapsas
      @nickchapsas Před 8 měsíci +7

      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.

    • @andersborum9267
      @andersborum9267 Před 8 měsíci +1

      @@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.

    • @mekowgli
      @mekowgli Před 7 měsíci

      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.

  • @LunicLynx
    @LunicLynx Před 8 měsíci +9

    Nice talk, but I really hoped for more insight in regards to what to log to benefit later.

  • @panosru
    @panosru Před 5 měsíci

    Εξαιρετική ομιλία Νίκο! Το τέλειο balance μεταξύ χιούμορ και χρήσιμης πληροφορίας!

  • @anon_y_mousse
    @anon_y_mousse Před 7 měsíci

    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.

  • @user-tj9gj2wx5d
    @user-tj9gj2wx5d Před 8 měsíci +12

    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.

    • @SBDavin
      @SBDavin Před 8 měsíci +3

      Exactly!
      "Watching Nick Chapsas? You're doing it wrong!"

    • @igelineau
      @igelineau Před 8 měsíci +4

      he has good content, it's what should matter...

    • @Qrzychu92
      @Qrzychu92 Před 8 měsíci +8

      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

  • @christian123542
    @christian123542 Před 6 měsíci

    Even his bad CZcams videos provide more information than this horrible talk.

  • @OeHomestead
    @OeHomestead Před 8 měsíci +3

    Meh..... Can't wait to not watch NC

    • @benbrist
      @benbrist Před 8 měsíci +3

      Why click then?