current efcore logging for executed command with message template:
Executed DbCommand ({elapsed}ms) [Parameters=[{parameters}], CommandType='{commandType}', CommandTimeout='{commandTimeout}']{newLine}{commandText}
logs elapsed metric as string.
code from RelationalCommandDiagnosticsLogger.cs
method CommandReaderExecuted
code
duration.TotalMilliseconds is formated using InvariantCulture with 0 decimal places. But still writes comma as thousand seperator.
e.g.
string.Format(CultureInfo.InvariantCulture, "{0:N0}",1234,5m) // will return 1,234
Therefore log tools will not recognize this value as number and you will not be able to use these metric as number. for example can't do aggregations.
change property to int as in the same class method:
DataReaderDisposing
current efcore logging for executed command with message template: Executed DbCommand ({elapsed}ms) [Parameters=[{parameters}], CommandType='{commandType}', CommandTimeout='{commandTimeout}']{newLine}{commandText}
logs elapsed metric as string. code from RelationalCommandDiagnosticsLogger.cs method CommandReaderExecuted code
duration.TotalMilliseconds is formated using InvariantCulture with 0 decimal places. But still writes comma as thousand seperator. e.g.
string.Format(CultureInfo.InvariantCulture, "{0:N0}",1234,5m) // will return 1,234
Therefore log tools will not recognize this value as number and you will not be able to use these metric as number. for example can't do aggregations.change property to int as in the same class method: DataReaderDisposing