【问题标题】:Mosquitto log files not generatingMosquitto 日志文件未生成
【发布时间】:2015-11-05 10:32:37
【问题描述】:

mosquitto 代理中,有一些配置可以写入事件日志文件。我正在使用以下配置并运行代理。

log_type all
log_dest file /root/Files/mosquitto.log
log_facility 5

虽然,我没有看到在/root/Files/mosquitto.log 位置生成任何日志

可能是什么问题?我正在使用 centos 6.7

编辑... 以下是配置文件内容

pid_file /var/run/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/

listener 1883
allow_anonymous false
auth_plugin /etc/mosquitto/plugin.so

listener 8883
cafile /etc/mosquitto/certs/ca.crt
certfile /etc/mosquitto/certs/server.crt
keyfile /etc/mosquitto/certs/server.key
include_dir /etc/mosquitto/conf.d

message_size_limit 268435455

log_type all 
log_dest file /root/Files/mosquitto.log
log_facility 5

【问题讨论】:

  • 你是怎么开始灭蚊的?
  • mosquitto -v -c customConfig.conf 你问的是这个吗?
  • @hardillb 将整个配置文件内容添加到问题中。

标签: logging mqtt mosquitto


【解决方案1】:

问题在于命令行上的“-v”。

运行 mosquitto --help 给出以下内容

...

-v : 详细模式 - 启用所有日志记录类型。这覆盖 配置文件中给出的任何日志记录选项。

...

重要的一点是第二句禁用配置文件中的所有日志记录指令

尝试不使用'-v'

【讨论】:

  • 我尝试不使用详细模式,但仍然没有生成日志文件。终端也不显示任何日志。
  • 什么版本的 mosquitto 和 CentOS?
  • 抱歉,在问题中发现了 centos 版本。另外,您以什么用户身份运行 mosquitto,他们是否具有对 /root/Files 的写入权限?
  • 我已经在运行 root 用户。虽然有一些访问问题。 chmod 成功了。谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-03-28
  • 1970-01-01
  • 2021-04-27
  • 1970-01-01
  • 1970-01-01
  • 2019-10-02
  • 1970-01-01
相关资源
最近更新 更多