Loggly released new version - Gen2. Gen2 is not implemented in winston-loggly package yet. After my communication with Loggly Team I found out a solution based on this issue comment:
var winston = require('winston');
require('winston-loggly');
var logger = new (winston.Logger)({
transports: [
//new (winston.transports.Console)(),
new (winston.transports.Loggly)({
inputToken: 'mytoken',
subdomain: 'mydomain',
auth: { username: 'myusername', password: 'pswd' },
json: true
})
]
});
Object.defineProperty(logger.transports.loggly.client.config, 'inputUrl', {
value: 'https://logs-01.loggly.com/inputs/',
enumerable: true,
configurable: true
});
logger.info('Hello Loggly!');