startup
Initialize your integration and setup logging
Summary
optional function startup(logger)
The startup method is called once when the integration is first started (or restarted). It should be used to perform any initialization logic that your integration requires. In addition, the startup
method is passed a Bunyan logger object which you can cache for later use.
Bunyan is an open source JSON logging library. You can find more information here https://github.com/trentm/node-bunyan
Parameters
logger
Once you have cached the Logger
object you can use it to log information to the integration log file. The simplest usage of the Logger is to log string
messages using one of the six provided logging levels.
You can also pass object literals to be converted into JSON and logged. If you are returning a single object you can pass that as the first parameter to any of the Logger
methods.
If you want to return multiple objects or properties you can do that as well.
Examples
The following example show how you can cache the logger object within the startup method for use elsewhere in the integration.js
file.
Last updated