Skip to content

Commit

Permalink
update branch to main (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Dec 17, 2021
1 parent 9b965d1 commit 26aaa6a
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ecs-logging-nodejs

[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmaster)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/master/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmain)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/main/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)

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).
In combination with [filebeat](https://www.elastic.co/products/beats/filebeat) you can 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 logs in one single place.
Expand Down
6 changes: 3 additions & 3 deletions docs/morgan.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ app.get('/error', function (req, res, next) {
app.listen(3000)
----

Running this script (the full example is https://github.com/elastic/ecs-logging-nodejs/blob/master/loggers/morgan/examples/express.js[here])
Running this script (the full example is https://github.com/elastic/ecs-logging-nodejs/blob/main/loggers/morgan/examples/express.js[here])
and making a request (via `curl -i localhost:3000/`) will produce log output
similar to the following:

Expand Down Expand Up @@ -144,7 +144,7 @@ app.use(morgan(ecsFormat({ format: 'tiny' }))) <1>
=== log.level

The `log.level` field will be "error" for response codes >= 500, otherwise
"info". For example, running https://github.com/elastic/ecs-logging-nodejs/blob/master/loggers/morgan/examples/express.js[examples/express.js]
"info". For example, running https://github.com/elastic/ecs-logging-nodejs/blob/main/loggers/morgan/examples/express.js[examples/express.js]
again, a `curl -i localhost:3000/error` will yield:

[source,cmd]
Expand Down Expand Up @@ -172,7 +172,7 @@ then fields are added to log records that {ecs-ref}/ecs-tracing.html[identify an
These fields allow cross linking between traces and logs in Kibana and support
log anomaly detection.

For example, running https://github.com/elastic/ecs-logging-nodejs/blob/master/loggers/morgan/examples/express-with-apm.js[examples/express-with-apm.js] and `curl -i localhost:3000/` results in a log record with the following:
For example, running https://github.com/elastic/ecs-logging-nodejs/blob/main/loggers/morgan/examples/express-with-apm.js[examples/express-with-apm.js] and `curl -i localhost:3000/` results in a log record with the following:

[source,cmd]
----
Expand Down
10 changes: 5 additions & 5 deletions docs/pino.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ For example:
}
----

The https://github.com/elastic/ecs-logging-nodejs/tree/master/loggers/pino/examples[examples/ directory]
The https://github.com/elastic/ecs-logging-nodejs/tree/main/loggers/pino/examples[examples/ directory]
shows sample programs using request and response logging:
https://github.com/elastic/ecs-logging-nodejs/tree/master/loggers/pino/examples/express-simple.js[with Express],
https://github.com/elastic/ecs-logging-nodejs/tree/master/loggers/pino/examples/express-with-pino-http.js[with the pino-http middleware package],
https://github.com/elastic/ecs-logging-nodejs/tree/main/loggers/pino/examples/express-simple.js[with Express],
https://github.com/elastic/ecs-logging-nodejs/tree/main/loggers/pino/examples/express-with-pino-http.js[with the pino-http middleware package],
etc.


Expand All @@ -214,7 +214,7 @@ then fields are added to log records that {ecs-ref}/ecs-tracing.html[identify an
These fields allow cross linking between traces and logs in Kibana and support
log anomaly detection.

For example, running https://github.com/elastic/ecs-logging-nodejs/blob/master/loggers/pino/examples/http-with-elastic-apm.js[examples/http-with-elastic-apm.js] and `curl -i localhost:3000/` results in a log record with the following:
For example, running https://github.com/elastic/ecs-logging-nodejs/blob/main/loggers/pino/examples/http-with-elastic-apm.js[examples/http-with-elastic-apm.js] and `curl -i localhost:3000/` results in a log record with the following:

[source,cmd]
----
Expand Down Expand Up @@ -253,7 +253,7 @@ const log = pino(ecsFormat({ apmIntegration: false }))
[[pino-considerations]]
=== Limitations and Considerations

The https://github.com/elastic/ecs-logging/tree/master/spec[ecs-logging spec]
The https://github.com/elastic/ecs-logging/tree/main/spec[ecs-logging spec]
suggests that the first three fields in log records must be `@timestamp`,
`log.level`, and `message`. Pino does not provide a mechanism to put
the `message` field near the front. Given that ordering of ecs-logging fields
Expand Down
8 changes: 4 additions & 4 deletions docs/winston.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ logger.info('hi')
logger.error('oops there is a problem', { foo: 'bar' })
----

Running this script (available https://github.com/elastic/ecs-logging-nodejs/blob/master/loggers/winston/examples/basic.js[here]) will produce log output similar to the following:
Running this script (available https://github.com/elastic/ecs-logging-nodejs/blob/main/loggers/winston/examples/basic.js[here]) will produce log output similar to the following:

[source,cmd]
----
Expand All @@ -94,7 +94,7 @@ the https://github.com/winstonjs/logform#timestamp[timestamp] formatter.

By default, the formatter will convert an `err` meta field that is an Error instance
to {ecs-ref}/ecs-error.html[ECS Error fields].
For https://github.com/elastic/ecs-logging-nodejs/blob/master/loggers/winston/examples/error.js[example]:
For https://github.com/elastic/ecs-logging-nodejs/blob/main/loggers/winston/examples/error.js[example]:

[source,js]
----
Expand Down Expand Up @@ -182,7 +182,7 @@ function handler (req, res) {

This will produce logs with request and response info using
{ecs-ref}/ecs-http.html[ECS HTTP fields].
For https://github.com/elastic/ecs-logging-nodejs/blob/master/loggers/winston/examples/http.js[example]:
For https://github.com/elastic/ecs-logging-nodejs/blob/main/loggers/winston/examples/http.js[example]:

[source,cmd]
----
Expand Down Expand Up @@ -233,7 +233,7 @@ then fields are added to log records that {ecs-ref}/ecs-tracing.html[identify an
These fields allow cross linking between traces and logs in Kibana and support
log anomaly detection.

For example, running https://github.com/elastic/ecs-logging-nodejs/blob/master/loggers/winston/examples/http-with-elastic-apm.js[examples/http-with-elastic-apm.js] and `curl -i localhost:3000/` results in a log record with the following:
For example, running https://github.com/elastic/ecs-logging-nodejs/blob/main/loggers/winston/examples/http-with-elastic-apm.js[examples/http-with-elastic-apm.js] and `curl -i localhost:3000/` results in a log record with the following:

[source,cmd]
----
Expand Down
2 changes: 1 addition & 1 deletion helpers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# @elastic/ecs-helpers

[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmaster)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/master/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmain)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/main/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)

A set of helpers for the ECS logging libraries. You should not directly used
this package, but the [ECS logging libraries](../loggers) instead.
Expand Down
2 changes: 1 addition & 1 deletion helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"bugs": {
"url": "https://github.com/elastic/ecs-logging-nodejs/issues"
},
"homepage": "https://github.com/elastic/ecs-logging-nodejs/blob/master/helpers/README.md",
"homepage": "https://github.com/elastic/ecs-logging-nodejs/blob/main/helpers/README.md",
"scripts": {
"test": "standard && tap --no-check-coverage --timeout ${TAP_TIMEOUT:-10} test/*.test.js"
},
Expand Down
2 changes: 1 addition & 1 deletion loggers/morgan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# @elastic/ecs-morgan-format

[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmaster)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/master/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmain)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/main/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)

This Node.js package provides a formatter for the
[morgan](https://www.npmjs.com/package/morgan) logging middleware compatible with
Expand Down
2 changes: 1 addition & 1 deletion loggers/morgan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"bugs": {
"url": "https://github.com/elastic/ecs-logging-nodejs/issues"
},
"homepage": "https://github.com/elastic/ecs-logging-nodejs/blob/master/loggers/morgan/README.md",
"homepage": "https://github.com/elastic/ecs-logging-nodejs/blob/main/loggers/morgan/README.md",
"scripts": {
"test": "standard && tap --timeout ${TAP_TIMEOUT:-10} test/*.test.js"
},
Expand Down
2 changes: 1 addition & 1 deletion loggers/pino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# @elastic/ecs-pino-format

[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmaster)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/master/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmain)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/main/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)

This Node.js package provides a formatter for the [pino](https://www.npmjs.com/package/pino)
logger compatible with [Elastic Common Schema (ECS) logging](https://www.elastic.co/guide/en/ecs/current/index.html).<br/>
Expand Down
2 changes: 1 addition & 1 deletion loggers/pino/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function createEcsPinoOptions (opts) {
// A mis-configured APM Agent can be "started" but not have a
// "serviceName".
if (apmServiceName) {
// Per https://github.com/elastic/ecs-logging/blob/master/spec/spec.json
// Per https://github.com/elastic/ecs-logging/blob/main/spec/spec.json
// "service.name" and "event.dataset" should be automatically set
// if not already by the user.
if (!isServiceNameInBindings) {
Expand Down
2 changes: 1 addition & 1 deletion loggers/pino/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"bugs": {
"url": "https://github.com/elastic/ecs-logging-nodejs/issues"
},
"homepage": "https://github.com/elastic/ecs-logging-nodejs/blob/master/loggers/pino/README.md",
"homepage": "https://github.com/elastic/ecs-logging-nodejs/blob/main/loggers/pino/README.md",
"scripts": {
"test": "standard && tap --timeout ${TAP_TIMEOUT:-10} test/*.test.js"
},
Expand Down
2 changes: 1 addition & 1 deletion loggers/winston/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# @elastic/ecs-winston-format

[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmaster)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/master/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
[![Build Status](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-nodejs%2Fecs-logging-nodejs-mbp%2Fmain)](https://apm-ci.elastic.co/job/apm-agent-nodejs/job/ecs-logging-nodejs-mbp/job/main/) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)

This Node.js package provides a formatter for the
[winston](https://www.npmjs.com/package/winston) logger compatible with
Expand Down
2 changes: 1 addition & 1 deletion loggers/winston/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"bugs": {
"url": "https://github.com/elastic/ecs-logging-nodejs/issues"
},
"homepage": "https://github.com/elastic/ecs-logging-nodejs/blob/master/loggers/winston/README.md",
"homepage": "https://github.com/elastic/ecs-logging-nodejs/blob/main/loggers/winston/README.md",
"scripts": {
"bench": "./benchmarks/bench",
"test": "standard && tap --timeout ${TAP_TIMEOUT:-10} test/*.test.js"
Expand Down

0 comments on commit 26aaa6a

Please sign in to comment.