info/warn level messages not showing... am I doing this right?
fschwiet opened this issue · 3 comments
I am able to log errors via winston to both the console and Loggly fine. When I log warnings or info level messages, only the console receives them. Any idea what I am doing wrong? Here is how I configure winston-loggly:
transports.push(new winston.transports.Loggly({
level: 'info',
token: config.get("loggly_token"),
subdomain: config.get("loggly_subdomain"),
auth: {
username: config.get("loggly_username"),
password: config.get("loggly_password")
},
json: true,
tags: config.get('is_production') ? ['production'] : []
}));
I haven't seen any level-related configuration on the loggly side. I believe I'm looking at all events on (on Loggly).
+1, can't tell what I'm missing!
EDIT: I realised later that my winston config was being overwritten at some point, doh!
I had the same problem when I started up with Winston-loggly. I solved it by adding the following to the configuration object passed in to new winston.transports.loggly(config):
levels: Winston.config.npm.levels
For your configuration this would become:
{
levels: winston.config.npm.levels, // configure the transport to have a set of log levels
level: 'info',
token: config.get("loggly_token"),
subdomain: config.get("loggly_subdomain"),
auth: {
username: config.get("loggly_username"),
password: config.get("loggly_password")
},
json: true,
tags: config.get('is_production') ? ['production'] : []
}