官方文档介绍
https://docs.emqx.io/broker/latest/cn/?q=%E6%97%A5%E5%BF%97
设置日志输出到文件中,日志级别debug
etc/emq.conf
## Console log. Enum: off, file, console, both
log.console = file
## Console log level. Enum: debug, info, notice, warning, error, critical, alert, emergency
log.console.level = debug
## Console log file 注意要打开下面一行的的注释,默认是注释掉的
log.console.file = log/console.log
重启 emq
bin 目录下执行
./emqttd stop
pa -aux | grep emq
kill <emq守护进程的id>
然后
./emqttd start
[root@iZwz9ijy6ieyxskc6kgg8rZ bin]# ./emqttd stop
ok
[root@iZwz9ijy6ieyxskc6kgg8rZ bin]# ps -aux | grep emq
root 1296 0.0 0.0 11624 340 ? S Jun03 0:06 /root/emqtt/emqttd-centos7-v2.2.0/emqttd/erts-8.3/bin/epmd -daemon
root 6234 0.0 0.0 112712 984 pts/1 S+ 14:40 0:00 grep --color=auto emq
[root@iZwz9ijy6ieyxskc6kgg8rZ bin]# kill 1296
[root@iZwz9ijy6ieyxskc6kgg8rZ bin]#
[root@iZwz9ijy6ieyxskc6kgg8rZ bin]#
[root@iZwz9ijy6ieyxskc6kgg8rZ bin]#
[root@iZwz9ijy6ieyxskc6kgg8rZ bin]# ps -aux | grep emq
root 6242 0.0 0.0 112708 984 pts/1 S+ 14:41 0:00 grep --color=auto emq
[root@iZwz9ijy6ieyxskc6kgg8rZ bin]#
[root@iZwz9ijy6ieyxskc6kgg8rZ bin]#
[root@iZwz9ijy6ieyxskc6kgg8rZ bin]# ./emqttd start
emqttd 2.2 is started successfully!
[root@iZwz9ijy6ieyxskc6kgg8rZ bin]#
进到 log 目录下 就可以看到 console.log 日志文件了
tail -f console.log 可以开始看日志信息 分析问题了