Skip to content

Commit

Permalink
Documentation Updates: Added content for custom writestream and fixed…
Browse files Browse the repository at this point in the history
… content for Inject context express middleware for server spans
  • Loading branch information
sunilkumarmax committed Sep 20, 2017
1 parent 8903855 commit 58e3346
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ tracer.init({
}
]
},
stream: { // optional but defaults to stdout
write: (content) => { // Modify the anonymous function to write logs to an writable stream
console.log(content)
}
},
serviceName: "ExampleService" // can set service name for entire tracer
})
```
Expand Down Expand Up @@ -102,7 +107,7 @@ const express = require('express')
const tracer = require('ctrace-js')
const app = express()

app.use(tracer.express)
app.use(tracer.express())

app.post('/users', (req, res) => {
// ...
Expand Down Expand Up @@ -181,7 +186,7 @@ context into the HTTP Headers for this purpose as follows.

```js
const headers = {}
tracer.inject(span, Tracer.FORMAT_HTTP_HEADERS, headers)
tracer.inject(span.context(), Tracer.FORMAT_HTTP_HEADERS, headers)
```

### Start Server Span
Expand Down

0 comments on commit 58e3346

Please sign in to comment.