@elastic/ecs-morgan-format
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -1,8 +0,15 @@ | ||
# Changelog | ||
# @elastic/ecs-morgan-format Changelog | ||
## v0.3.0 | ||
- Serialize "log.level" as a top-level dotted field per | ||
https://github.com/elastic/ecs-logging/pull/33. | ||
[#23](https://github.com/elastic/ecs-logging-js/pull/23) | ||
## v0.2.0 | ||
- Use the version number provided by ecs-helpers - [#13](https://github.com/elastic/ecs-logging-js/pull/13) | ||
## v0.1.0 | ||
## v0.1.0 | ||
Initial release. |
@@ -22,6 +22,3 @@ // Licensed to Elasticsearch B.V under one or more agreements. | ||
'@timestamp': new Date().toISOString(), | ||
log: { | ||
level: res.statusCode < 500 ? 'info' : 'error', | ||
logger: 'morgan' | ||
}, | ||
'log.level': res.statusCode < 500 ? 'info' : 'error', | ||
message: messageFormat(token, req, res), | ||
@@ -28,0 +25,0 @@ ecs: { version } |
{ | ||
"name": "@elastic/ecs-morgan-format", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "A formatter for the morgan logger compatible with Elastic Common Schema.", | ||
@@ -34,3 +34,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@elastic/ecs-helpers": "^0.2.0" | ||
"@elastic/ecs-helpers": "^0.3.0" | ||
}, | ||
@@ -37,0 +37,0 @@ "devDependencies": { |
@@ -10,2 +10,8 @@ <img align="right" width="auto" height="auto" src="https://www.elastic.co/static-res/images/elastic-logo-200.png"> | ||
--- | ||
**Please note** that this library is in a **beta** version and backwards-incompatible changes might be introduced in future releases. While we strive to comply to [semver](https://semver.org/), we can not guarantee to avoid breaking changes in minor releases. | ||
--- | ||
## Install | ||
@@ -12,0 +18,0 @@ ```sh |
@@ -62,3 +62,3 @@ // Licensed to Elasticsearch B.V under one or more agreements. | ||
const log = JSON.parse(line) | ||
t.is(line, `{"@timestamp":"${log['@timestamp']}","log":{"level":"info","logger":"morgan"},"message":"${JSON.stringify(log.message).slice(1, -1)}","ecs":{"version":"${version}"},"http":{"version":"1.1","request":{"method":"post","headers":{"accept-encoding":"gzip, deflate","content-type":"application/json","host":"${log.http.request.headers.host}","connection":"close"},"body":{"bytes":17}},"response":{"status_code":200,"headers":{"x-powered-by":"Express"}}},"url":{"path":"/","domain":"localhost","query":"foo=bar","full":"/?foo=bar"},"user_agent":{"original":"cool-agent"}}`) | ||
t.is(line, `{"@timestamp":"${log['@timestamp']}","log.level":"info","message":"${JSON.stringify(log.message).slice(1, -1)}","ecs":{"version":"${version}"},"http":{"version":"1.1","request":{"method":"post","headers":{"accept-encoding":"gzip, deflate","content-type":"application/json","host":"${log.http.request.headers.host}","connection":"close"},"body":{"bytes":17}},"response":{"status_code":200,"headers":{"x-powered-by":"Express"}}},"url":{"path":"/","domain":"localhost","query":"foo=bar","full":"http://localhost:${server.address().port}/?foo=bar"},"user_agent":{"original":"cool-agent"}}`) | ||
}) | ||
@@ -65,0 +65,0 @@ |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
18816
49
119
1
+ Added@elastic/ecs-helpers@0.3.0(transitive)
- Removed@elastic/ecs-helpers@0.2.1(transitive)
Updated@elastic/ecs-helpers@^0.3.0