changed
CHANGELOG.md
|
@@ -1,5 1,11 @@
|
1
1
|
## CHANGELOG
|
2
2
|
|
3
|
### `v1.24.4`
|
4
|
|
5
|
Tweaks
|
6
|
* Support per-log message metadata. [#330](https://github.com/newrelic/elixir_agent/pull/330) Thanks @mattgibson!
|
7
|
* Properly render IO list log message. [#329](https://github.com/newrelic/elixir_agent/pull/329) Thanks @mattgibson!
|
8
|
|
3
9
|
### `v1.24.3`
|
4
10
|
|
5
11
|
Fixes
|
changed
VERSION
|
@@ -1 1 @@
|
1
|
- 1.24.3
|
1
|
1.24.4
|
changed
hex_metadata.config
|
@@ -158,4 158,4 @@
|
158
158
|
{<<"optional">>,true},
|
159
159
|
{<<"repository">>,<<"hexpm">>},
|
160
160
|
{<<"requirement">>,<<">= 0.11.0">>}]]}.
|
161
|
- {<<"version">>,<<"1.24.3">>}.
|
161
|
{<<"version">>,<<"1.24.4">>}.
|
changed
lib/new_relic/logs_in_context.ex
|
@@ -60,12 60,12 @@ defmodule NewRelic.LogsInContext do
|
60
60
|
|
61
61
|
defp prepare_log(%{msg: {:string, msg}} = log) do
|
62
62
|
%{
|
63
|
- message: msg,
|
63
|
message: IO.iodata_to_binary(msg),
|
64
64
|
timestamp: System.convert_time_unit(log.meta.time, :microsecond, :millisecond),
|
65
65
|
"log.level": log.level
|
66
66
|
}
|
67
67
|
|> Map.merge(log_metadata(log))
|
68
|
- |> Map.merge(logger_metadata())
|
68
|
|> Map.merge(custom_metadata(log))
|
69
69
|
|> Map.merge(tracing_metadata())
|
70
70
|
end
|
71
71
|
|
|
@@ -91,18 91,13 @@ defmodule NewRelic.LogsInContext do
|
91
91
|
}
|
92
92
|
end
|
93
93
|
|
94
|
- defp logger_metadata() do
|
95
|
- case :logger.get_process_metadata() do
|
96
|
- :undefined ->
|
97
|
- %{}
|
98
|
-
|
99
|
- metadata ->
|
100
|
- [metadata: metadata]
|
101
|
- |> NewRelic.Util.deep_flatten()
|
102
|
- |> NewRelic.Util.coerce_attributes()
|
103
|
- |> Map.new()
|
104
|
- |> Map.delete("metadata.size")
|
105
|
- end
|
94
|
@ignored [:domain, :file, :gl, :line, :mfa, :pid, :time]
|
95
|
defp custom_metadata(log) do
|
96
|
[metadata: Map.drop(log.meta, @ignored)]
|
97
|
|> NewRelic.Util.deep_flatten()
|
98
|
|> NewRelic.Util.coerce_attributes()
|
99
|
|> Map.new()
|
100
|
|> Map.delete("metadata.size")
|
106
101
|
end
|
107
102
|
|
108
103
|
def linking_metadata() do
|