Install logger using npm
npm install --save git+ssh://git@github.com:AdeptMind/adept-logger-node.git
To send logs to adept_analytics_v1
firehose do following:
import { AdeptLogger, AdeptFireHoseHandler, AdeptStdOutHandler } from 'adept-logger-node';
const FIREHOSE_STREAM = 'adept_analytics_v1';
const logger = new AdeptLogger();
logger.addHandler(new AdeptFireHoseHandler(FIREHOSE_STREAM))
logger.addHandler(new AdeptStdOutHandler()) // This handler will simply log to console
// If logs are being sent from a specific shop, you can include `shop_id` in `msg` object i.e. msg['shop_id'] = SHOP_ID
logger.log({
event: 'ADEPT_SESSION', // Event Name
message: msg, // It could be a string or a JSON objct
})
For firehose handler to work properly you need to configure aws using your AWS IAM credentials and us-west-2
region.
aws configure