nblumhardt / serilog-timings

Extends Serilog with support for timed operations
Apache License 2.0
218 stars 22 forks source link

System.DivideByZeroException #56

Closed KunzeAndreas closed 2 years ago

KunzeAndreas commented 2 years ago

Two of our customers get an exception. Unfortunately we cannot reproduce this. Maybe, the stacktrace helps. Version in use 3.0.1

System.DivideByZeroException: Attempted to divide by zero. at SerilogTimings.Operation.GetTimestamp() at SerilogTimings.Operation..ctor(ILogger target, String messageTemplate, Object[] args, CompletionBehaviour completionBehaviour, LogEventLevel completionLevel, LogEventLevel abandonmentLevel, Nullable`1 warningThreshold) at SerilogTimings.Operation.Time(String messageTemplate, Object[] args)

nblumhardt commented 2 years ago

Hi! This issue was fixed in v3.0.1, I believe - the division operation in question is now based on double, which doesn't trigger this exception. Is it possible your customers are somehow running v3.0.0 of the assembly?

nblumhardt commented 2 years ago

(see also: https://github.com/nblumhardt/serilog-timings/pull/50)

KunzeAndreas commented 2 years ago

Hi, Yes, you are right. In release version we use 3.0.0, in develop 3.0.1 Thank you