Skip to content

2.0 Migration Guide

Robin Jacobs edited this page Mar 7, 2022 · 3 revisions

This document means to help you upgrade your application to r7insight_node==2.0 either from le_node or an older version of r7insight_node.

Keep in mind if you are migrating from le_node you now need to specify a region in the Logger constructor.

Care has been taken to minimize the number of unnecessary breaking changes in 2.0 but breaking changes have been implemented, hence the major release.

Changes

The following changes were made in the 2.0 release of r7insight_node:

  • Upgrade to support latest version of node (oldest version we now support is 8.10.0)
  • Upgrade all package dependencies to latest versions
  • Remove support for winston < 3.0.0.

This guide demonstrates how to upgrade to the supported winston version.

  • All references of Logentries have been updated to Insight
  • 'connection drain' Logger event (deprecated) has been removed.

Migration

Here is the current list of changes you should make to your project to upgrade to 2.0:

  • Change Winston transport Logentries references to Insight
  • Instantiate a winston transport when adding
// Before
winston.add(winston.transports.Logentries({ token: '<token>', region: '<region>' });
// Current
winston.add(new winston.transports.Insight({ token: '<token>', region: '<region>' });
  • Ensure you're running winston >= 3.0.0
  • Ensure you're running node >= 8.10.0
  • Change references of "connection drain" to "buffer drain" or Logger.bufferDrainEvent

Migrating from le_node

If you are migrating from the old le_node package, you will likely want to add region: 'eu' to the constructor (as Logentries was only available in EU).

Note

Keep in mind that this is not a comprehensive guide and other things might break.
If you encounter any issues that you have fixed, please feel free to open a pull request letting us know what extra information to include in this guide for other users.

Clone this wiki locally