Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
node-version: [14, 16, 18, 20]
node-version: [20, 22, 24]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
5 changes: 2 additions & 3 deletions docs/configuration/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ If the framework assigned to the source is not in use, then this source will be
Our supported server frameworks are:

* [Express](https://expressjs.com/): declare as `express`
* [Restify](http://restify.com/): declare as `restify`
* [Connect](https://www.npmjs.com/package/connect): declare as `connect`
* [Fastify](https://fastify.dev/): declare as `fastify`
* [Node.js HTTP](https://nodejs.org/api/http.html): declare as `plainhttp`
Expand All @@ -277,8 +276,8 @@ Example of field with multiple framework specific sources:
},
{
"type": "static",
"value": "restify-is-running",
"framework": "restify"
"value": "fastify-is-running",
"framework": "fastify"
},
{
"type": "static",
Expand Down
9 changes: 4 additions & 5 deletions docs/configuration/framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@ By default the library will be configured to run with express. If you are going

```js
{
"framework": "restify"
"framework": "fastify"
}
```

2. Set the server framework from a logger instance by calling:

```js
log.forceLogger("connect")
```
```js
log.forceLogger("fastify")
```

Our supported server frameworks are:

* [Express](https://expressjs.com/): declare as `express`
* [Restify](http://restify.com/): declare as `restify`
* [Connect](https://www.npmjs.com/package/connect): declare as `connect`
* [Fastify](https://fastify.dev/): declare as `fastify`
* [Node.js HTTP](https://nodejs.org/api/http.html): declare as `plainhttp`
1 change: 0 additions & 1 deletion docs/getting-started/01-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ To take full advantage of cf-nodejs-logging-support make sure to fulfill followi
* Use one of the supported server frameworks:
* [Express](https://expressjs.com/)
* [Connect](https://www.npmjs.com/package/connect)
* [Restify](http://restify.com/)
* [Fastify](https://fastify.dev/)
* [Node.js HTTP](https://nodejs.org/api/http.html)

Expand Down
33 changes: 5 additions & 28 deletions docs/getting-started/02-framework-samples.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,6 @@ const server = http.createServer(app).listen(3000, () => {
})
```

## Restify

```js
const restify = require('restify')
const log = require('cf-nodejs-logging-support')
const app = restify.createServer()

// Configure logger for working with Restify framework
log.setFramework(log.Framework.Restify)

// Add the logger middleware to write access logs
app.use(log.logNetwork)

// Handle '/' path
app.get("/", (req, res, next) => {
// Write a log message bound to request context
req.logger.info(`Sending a greeting`)
res.send("Hello Restify")
next()
})

// Listen on specified port
app.listen(3000, () => {
// Formatted log message
log.info("Server is listening on port %d", app.address().port)
})
```

## Fastify

```js
Expand Down Expand Up @@ -157,3 +129,8 @@ server.listen(3000, () => {
log.info("Server is listening on port %d", server.address().port)
})
```

## Restify

As of version 8.0.0, restify is no longer supported by cf-nodejs-logging-support.
Please consider switching to one of the other supported server frameworks.
Loading