Allow to configure different log_levels (e.g. only WARN/ERROR).
@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
@tb-killa this can be easily done by using the debug module.
https://github.com/Koenkk/zigbee2mqtt/blob/master/lib/controller.js#L8
https://github.com/Koenkk/zigbee2mqtt/blob/master/lib/controller.js#L180
Would you mind doing a PR?
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'
@Koenkk added in commit https://github.com/Koenkk/zigbee2mqtt/pull/110/commits/c65bd2b60b34e0372a52aefb88d09495260195f7
I think this issue is done, what do you think @ciotlosm ?
I think so too
Most helpful comment
@Koenkk would be nice to be able to change this through mqtt while running.