Zigbee2mqtt: Configure logging

Created on 31 May 2018  路  9Comments  路  Source: Koenkk/zigbee2mqtt

Allow to configure different log_levels (e.g. only WARN/ERROR).

feature request

Most helpful comment

@Koenkk would be nice to be able to change this through mqtt while running.

All 9 comments

@Koenkk would be nice to be able to change this through mqtt while running.

We should also ADD this type of "enable extended Zigbee-Package debugging" like mentioned here: https://github.com/Koenkk/zigbee2mqtt/issues/36#issuecomment-394095615

It seems that changing log levels is possible also during runtime. See https://github.com/winstonjs/winston#using-logging-levels

You may also dynamically change the log level of a transport:

const transports = {
  console: new winston.transports.Console({ level: 'warn' }),
  file: new winston.transports.File({ filename: 'combined.log', level: 'error' })
};

const logger = winston.createLogger({
  transports: [
    transports.console,
    transports.file
  ]
});

logger.info('Will not be logged in either transport!');
transports.console.level = 'info';
transports.file.level = 'info';
logger.info('Will be logged in both transports!');

@tb-killa if you can point me in the right direction based on comments form @Koenkk happy to have a look.

I think we should also allow a

advanced:
  log_level: 'warn'

I think this issue is done, what do you think @ciotlosm ?

I think so too

Was this page helpful?
0 / 5 - 0 ratings