diff --git a/CHANGELOG.md b/CHANGELOG.md index 255fbf0..8e44094 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.5.0 (2020-08-27) + +- Updated supported ECS version to 1.6.0 ([#24](https://github.com/elastic/ecs-logging-python/pull/24)) +- Added support for `LogRecord.stack_info` ([#23](https://github.com/elastic/ecs-logging-python/pull/23)) +- Fixed normalizing of items in `list` that aren't of type + `dict` ([#22](https://github.com/elastic/ecs-logging-python/pull/22), contributed by [`@camerondavison`](https://github.com/camerondavison)) + ## 0.4 (2020-08-04) - Added automatic collection of ECS fields `trace.id`, `span.id`, and `transaction.id` for diff --git a/ecs_logging/__init__.py b/ecs_logging/__init__.py index 11e8722..a1aef6e 100644 --- a/ecs_logging/__init__.py +++ b/ecs_logging/__init__.py @@ -4,7 +4,7 @@ from ._stdlib import StdlibFormatter from ._structlog import StructlogFormatter -__version__ = "0.4" +__version__ = "0.5.0" __all__ = [ "ECS_VERSION", "StdlibFormatter", diff --git a/ecs_logging/_meta.py b/ecs_logging/_meta.py index d2c5f09..e317ff8 100644 --- a/ecs_logging/_meta.py +++ b/ecs_logging/_meta.py @@ -1 +1 @@ -ECS_VERSION = "1.5.0" +ECS_VERSION = "1.6.0" diff --git a/tests/test_apm.py b/tests/test_apm.py index dd0a282..f5b9202 100644 --- a/tests/test_apm.py +++ b/tests/test_apm.py @@ -33,7 +33,7 @@ def test_elasticapm_structlog_log_correlation_ecs_fields(): ecs = json.loads(stream.getvalue().rstrip()) ecs.pop("@timestamp") assert ecs == { - "ecs": {"version": "1.5.0"}, + "ecs": {"version": "1.6.0"}, "log": {"level": "info"}, "message": "test message", "span": {"id": span_id}, @@ -71,7 +71,7 @@ def test_elastic_apm_stdlib_no_filter_log_correlation_ecs_fields(): ecs = json.loads(stream.getvalue().rstrip()) assert ecs == { - "ecs": {"version": "1.5.0"}, + "ecs": {"version": "1.6.0"}, "log": { "level": "info", "logger": "apm-logger", @@ -115,7 +115,7 @@ def test_elastic_apm_stdlib_with_filter_log_correlation_ecs_fields(): ecs = json.loads(stream.getvalue().rstrip()) assert ecs == { - "ecs": {"version": "1.5.0"}, + "ecs": {"version": "1.6.0"}, "log": { "level": "info", "logger": "apm-logger", @@ -162,7 +162,7 @@ def test_elastic_apm_stdlib_exclude_fields(): ecs = json.loads(stream.getvalue().rstrip()) assert ecs == { - "ecs": {"version": "1.5.0"}, + "ecs": {"version": "1.6.0"}, "log": { "level": "info", "logger": "apm-logger", diff --git a/tests/test_stdlib_formatter.py b/tests/test_stdlib_formatter.py index 72fb496..ca15541 100644 --- a/tests/test_stdlib_formatter.py +++ b/tests/test_stdlib_formatter.py @@ -39,7 +39,7 @@ def test_record_formatted(): formatter = ecs_logging.StdlibFormatter(exclude_fields=["process"]) assert formatter.format(make_record()) == ( - '{"@timestamp":"2020-03-20T14:12:46.123Z","ecs":{"version":"1.5.0"},' + '{"@timestamp":"2020-03-20T14:12:46.123Z","ecs":{"version":"1.6.0"},' '"log":{"level":"debug","logger":"logger-name","origin":{"file":{"line":10,"name":"file.py"},' '"function":"test_function"},"original":"1: hello"},"message":"1: hello"}' ) @@ -54,7 +54,7 @@ def format_to_ecs(self, record): formatter = CustomFormatter(exclude_fields=["process"]) assert formatter.format(make_record()) == ( - '{"@timestamp":"2020-03-20T14:12:46.123Z","custom":"field","ecs":{"version":"1.5.0"},' + '{"@timestamp":"2020-03-20T14:12:46.123Z","custom":"field","ecs":{"version":"1.6.0"},' '"log":{"level":"debug","logger":"logger-name","origin":{"file":{"line":10,"name":"file.py"},' '"function":"test_function"},"original":"1: hello"},"message":"1: hello"}' ) @@ -68,7 +68,7 @@ def test_can_be_set_on_handler(): handler.handle(make_record()) assert stream.getvalue() == ( - '{"@timestamp":"2020-03-20T14:12:46.123Z","ecs":{"version":"1.5.0"},' + '{"@timestamp":"2020-03-20T14:12:46.123Z","ecs":{"version":"1.6.0"},' '"log":{"level":"debug","logger":"logger-name","origin":{"file":{"line":10,"name":"file.py"},' '"function":"test_function"},"original":"1: hello"},"message":"1: hello"}\n' ) @@ -102,7 +102,7 @@ def test_extra_is_merged(time, logger): assert isinstance(ecs["log"]["origin"]["file"].pop("line"), int) assert ecs == { "@timestamp": "2020-03-20T16:16:37.187Z", - "ecs": {"version": "1.5.0"}, + "ecs": {"version": "1.6.0"}, "log": { "level": "info", "logger": logger.name, diff --git a/tests/test_structlog_formatter.py b/tests/test_structlog_formatter.py index 53970f9..4c97124 100644 --- a/tests/test_structlog_formatter.py +++ b/tests/test_structlog_formatter.py @@ -14,7 +14,7 @@ def test_event_dict_formatted(time): formatter = ecs_logging.StructlogFormatter() assert formatter(None, "debug", make_event_dict()) == ( - '{"@timestamp":"2020-03-20T16:16:37.187Z","ecs":{"version":"1.5.0"},' + '{"@timestamp":"2020-03-20T16:16:37.187Z","ecs":{"version":"1.6.0"},' '"log":{"level":"debug","logger":"logger-name"},"message":"test message"}' ) @@ -36,6 +36,6 @@ def test_can_be_set_as_processor(time): assert stream.getvalue() == ( '{"@timestamp":"2020-03-20T16:16:37.187Z","custom":"key",' - '"dot":{"ted":1},"ecs":{"version":"1.5.0"},"log":{"level":"debug"},' + '"dot":{"ted":1},"ecs":{"version":"1.6.0"},"log":{"level":"debug"},' '"message":"test message"}\n' )