~/talk

You are doing logging in .NET wrong. Let’s fix it.

Talkat NDC London 2024 · 2024-01-29..02-02· [developer-experience, observability]
slides:none on file

Claims concrete fixes for .NET logging: treat the log text as a message template not a computed string, stop using string interpolation/concatenation to avoid per-entry string and boxing allocations, adopt structured logging so parameters like paymentId become queryable fields, use Serilog or the built-in ILogger Source Generator or Serilog overloads to avoid unnecessary boxing, set default level to warning, and be laconic. Implementing these cuts log churn, lowers bills (one case reports a 99% logging cost reduction) and preserves debuggability.

AI-written summary · about

  1. 0:00Logging in .NET
  2. 1:49Talk title concerns
  3. 3:13Myth: no logging needed
  4. 6:24What this talk is really about
  5. 7:28Rule 1: Message template
  6. 8:35Logging mistakes
  7. 12:12String interpolation internals
  8. 14:03Stack vs Heap memory
  9. 19:18Boxing impact on logging
  10. 23:15C# 10 interpolation handlers
  11. 26:04Logging performance cost
  12. 27:06Rule 2: No string interpolation
  13. 29:14Structured logging intro
  14. 31:00Rule 3: Structured logging
  15. 33:31Serilog structured logging
  16. 36:02Log levels impact
  17. 39:48Rule 4: Avoid boxing
  18. 40:10Source generators for logging
  19. 43:43Rule 6: Avoid over-engineering
  20. 46:51Rule 7: Default log level
  21. 50:42Logging performance vs responsibility
  22. 51:27Why we log
  23. 52:29Rule 8: Log only necessary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.