emqtt服务器开启日志

官方文档介绍
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 可以开始看日志信息 分析问题了

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值