ecs-logging 0.2.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.asciidoc +10 -0
- data/Gemfile +17 -0
- data/README.md +1 -1
- data/bin/dev +18 -0
- data/docs/setup.asciidoc +1 -1
- data/lib/ecs_logging/logger.rb +12 -0
- data/lib/ecs_logging/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3a81f133f4afd81becd74097f04605c64aa775ba3d608b098796aa529e7cd3b5
|
|
4
|
+
data.tar.gz: 1956240ae662101b9bb8ad9921eae6d7df22b4d203f105c70b88bd509b2f308a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69401d9254d264f341cce477be077d6d2dd7955b012daef75bd7517d91a5d25c46137f274445b86ec20be0004c3e08462f52dc1f92c5d07abecac48d475c7a21
|
|
7
|
+
data.tar.gz: 5ceb443448b0bd5e75ed5f6acce0177f3916dffd31fe321031c380acb83ed4de8a2f239de7b815564214c08a8b14902e1ae1a28ca7b4167bb3acadf914018588
|
data/CHANGELOG.asciidoc
CHANGED
|
@@ -32,6 +32,16 @@ endif::[]
|
|
|
32
32
|
==== Unreleased
|
|
33
33
|
////
|
|
34
34
|
|
|
35
|
+
[[release-notes-1.x]]
|
|
36
|
+
=== ECS logging Ruby 1.x
|
|
37
|
+
|
|
38
|
+
[[release-notes-1.0.0]]
|
|
39
|
+
==== 1.0.0 (2021-02-09)
|
|
40
|
+
|
|
41
|
+
===== Added
|
|
42
|
+
|
|
43
|
+
- Add tracing IDs from Elastic APM if running alongside {pull}14[#14]
|
|
44
|
+
|
|
35
45
|
[[release-notes-0.x]]
|
|
36
46
|
=== ECS logging Ruby 0.x
|
|
37
47
|
|
data/Gemfile
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
|
3
|
+
# this work for additional information regarding copyright
|
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
+
# not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
|
12
|
+
# software distributed under the License is distributed on an
|
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
# KIND, either express or implied. See the License for the
|
|
15
|
+
# specific language governing permissions and limitations
|
|
16
|
+
# under the License.
|
|
17
|
+
|
|
1
18
|
source "https://rubygems.org"
|
|
2
19
|
|
|
3
20
|
gemspec
|
data/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://apm-ci.elastic.co/job/apm-agent-ruby/job/ecs-logging-ruby-mbp/job/master/) [](https://rubygems.org/gems/ecs-logging)
|
|
4
4
|
|
|
5
5
|
This set of libraries allows you to transform your application logs to structured logs that comply with the [Elastic Common Schema (ECS)](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html).
|
|
6
|
-
In combination with [
|
|
6
|
+
In combination with [Filebeat](https://www.elastic.co/products/beats/filebeat), send your logs directly to Elasticsearch and leverage [Kibana's Logs app](https://www.elastic.co/guide/en/observability/current/monitor-logs.html) to inspect all of your logs in a single place.
|
|
7
7
|
See [ecs-logging](https://github.com/elastic/ecs-logging) for other ECS logging libraries and more resources about ECS & logging.
|
|
8
8
|
|
|
9
9
|
---
|
data/bin/dev
CHANGED
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
4
|
+
# license agreements. See the NOTICE file distributed with
|
|
5
|
+
# this work for additional information regarding copyright
|
|
6
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
7
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
|
8
|
+
# not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing,
|
|
14
|
+
# software distributed under the License is distributed on an
|
|
15
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
# KIND, either express or implied. See the License for the
|
|
17
|
+
# specific language governing permissions and limitations
|
|
18
|
+
# under the License.
|
|
19
|
+
|
|
2
20
|
# frozen_string_literal: true
|
|
3
21
|
|
|
4
22
|
require 'optparse'
|
data/docs/setup.asciidoc
CHANGED
data/lib/ecs_logging/logger.rb
CHANGED
|
@@ -43,6 +43,12 @@ module EcsLogging
|
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
+
if apm_agent_present_and_running?
|
|
47
|
+
extras[:"transaction.id"] = ElasticAPM.current_transaction&.id
|
|
48
|
+
extras[:"trace.id"] = ElasticAPM.current_transaction&.trace_id
|
|
49
|
+
extras[:"span.id"] = ElasticAPM.current_span&.id
|
|
50
|
+
end
|
|
51
|
+
|
|
46
52
|
@logdev.write(
|
|
47
53
|
format_message(
|
|
48
54
|
format_severity(severity),
|
|
@@ -87,5 +93,11 @@ module EcsLogging
|
|
|
87
93
|
def format_message(severity, datetime, progname, msg, **extras)
|
|
88
94
|
formatter.call(severity, datetime, progname, msg, **extras)
|
|
89
95
|
end
|
|
96
|
+
|
|
97
|
+
def apm_agent_present_and_running?
|
|
98
|
+
return false unless defined?(::ElasticAPM)
|
|
99
|
+
|
|
100
|
+
ElasticAPM.running?
|
|
101
|
+
end
|
|
90
102
|
end
|
|
91
103
|
end
|
data/lib/ecs_logging/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ecs-logging
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mikkel Malmberg
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-02-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Write a longer description or delete this line.
|
|
14
14
|
email:
|