log 命令

log 命令用于设置日志等级。访问 Documentation of logger log 命令 - 图1 (opens new window) 以获取详细信息

log set-level <Level>设置主日志等级和所有 Handlers 日志等级
log primary-level查看主日志等级
log primary-lelvel <Level>设置主日志等级
log handlers list查看当前安装的所有 Hanlders
log handlers set-level <HandlerId> <Level>设置指定 Hanlder 的日志等级

log set-level <Level>

设置主日志等级和所有 Handlers 日志等级:

  1. $ ./bin/emqx_ctl log set-level debug
  2. debug

log primary-level

查看主日志等级:

  1. $ ./bin/emqx_ctl log primary-level
  2. debug

log primary-level <Level>

设置主日志等级:

  1. $ ./bin/emqx_ctl log primary-level info
  2. info

log handlers list

查看当前安装的所有 Hanlders:

  1. $ ./bin/emqx_ctl log handlers list
  2. LogHandler(id=emqx_logger_handler, level=debug, destination=unknown)
  3. LogHandler(id=file, level=debug, destination=log/emqx.log)
  4. LogHandler(id=default, level=debug, destination=console)

log handlers set-level <HandlerId> <Level>

设置指定 Hanlder 的日志等级:

  1. $ ./bin/emqx_ctl log handlers set-level emqx_logger_handler error
  2. error