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.setFramework("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.
33 changes: 33 additions & 0 deletions docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,39 @@ permalink: /migration/
nav_order: 2
---


# Migrate from Version 7.x to Version 8.x

## Removed Restify support

Restify is no longer supported as a server framework.
If you are using restify, please switch to one of the other supported server frameworks (e.g. express or fastify) and adjust your configuration accordingly.
See [Server Framework](/cf-nodejs-logging-support/configuration/framework) for more details on how to set the server framework.

## Removed legacy methods

Following methods have been removed in version 8.x:

- `forceLogger()` has been removed.
Use `setFramework` to set the server framework instead.
- `overrideCustomFieldFormat()` has been removed.
Use `setCustomFieldsFormat` instead.
- `overrideNetworkField()` has been removed.
Please use the custom fields feature to achieve a similar behavior.
See [Custom Fields](/cf-nodejs-logging-support/configuration/custom-fields) for more details.
Alternatively, you can also configure a static field via advanced configuration.
See [Advanced Configuration](/cf-nodejs-logging-support/configuration) for more details.
- `setLogPattern()` has been removed.
The features was already discontinued in version 7 and is not supported anymore.
Use a custom sink function to achieve a similar behavior.

## Minimum Node.js version is now 20

As of version 8.x, the minimum supported Node.js version is 20.
If you are using an older version of Node.js, please upgrade to version 20 or later to use the latest version of the library.



# Migrate from Version 6.x to Version 7.x

Version 7.x introduces a redesigned architecture based on TypeScript.
Expand Down
Loading
Loading