Skip to content

Commit

Permalink
Add duration and duration_ms for logfmt format
Browse files Browse the repository at this point in the history
Log processors sometimes parse duration_human as string (because of the added 'ms') which is not always useful.
  • Loading branch information
woutersmeenk committed Jun 28, 2024
1 parent b80407e commit 56e391e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add support for Ruby 3.3
- Allow SyncProcessor to be called from appenders
- Fix incorrect metrics usage examples in documentation
- Add `:duration_ms` to Logfmt fomatter

## [4.15.0]

Expand Down
2 changes: 1 addition & 1 deletion lib/semantic_logger/formatters/logfmt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def call(log, logger)
private

def raw_to_logfmt
@parsed = @raw.slice(time_key, :level, :name, :message, :duration).merge(tag: "success")
@parsed = @raw.slice(time_key, :level, :name, :message, :duration, :duration_ms).merge(tag: "success")
handle_tags
handle_payload
handle_exception
Expand Down

0 comments on commit 56e391e

Please sign in to comment.