Mosquitto配置----日志设置

Mosquitto 搭建及配置 简介: Eclipse Mosquitto是一个开源消息代理,实现了MQTT协议版本3.1和3.1.1、5.0。Mosquitto轻量,适用于低功耗单板计算机到完整服务器的所有设备。 其他服务器代理实现:https://github.com/mqtt/mqtt.github.io/wiki/servers 各操作系统安装指引:https://mosquitto.org/download/ 下载安装 以Ubuntu16为例 添加到存储库列表 sudo apt-add-repository ppa:mosq 阅读详情
AI摘要

本文详细介绍了Mosquitto消息代理服务器的日志配置方法,包括日志目标的选择(如控制台、文件、syslog等)、日志消息类型(如错误、警告、通知等)的设定,以及如何设置日志时间戳和websockets的日志级别。

Mosquitto配置----日志设置
[plain]  view plain  copy
  1. # =================================================================  
  2. # Logging  
  3. # 日志信息  
  4. # =================================================================  
  5.   
  6. # Places to log to. Use multiple log_dest lines for multiple   
  7. # logging destinations.  
  8. # 记录日志,使用多个log_dest行对应多个日志信息的描述  
  9. #  
  10. # Possible destinations are: stdout stderr syslog topic file  
  11. # log_dest可能的选项有: stdout stderr syslog topic file  
  12. #  
  13. # stdout and stderr log to the console on the named output.  
  14. # stdout和stderr的日志输出在控制台  
  15. #  
  16. # syslog uses the userspace syslog facility which usually ends up   
  17. # in /var/log/messages or similar.  
  18. # syslog使用用户空间记录日志的级别通常保存在/var/log/messages或者邮件中  
  19. #  
  20. # topic logs to the broker topic '$SYS/broker/log/<severity>',   
  21. # 主题日志保存在代理服务器的主题日志路径下面 '$SYS/broker/log/<severity>'  
  22. #  
  23. # where severity is one of D, E, W, N, I, M which are debug, error,   
  24. # warning, notice, information and message. Message type severity is used by  
  25. # the subscribe/unsubscribe log_types and publishes log messages to  
  26. # $SYS/broker/log/M/susbcribe or $SYS/broker/log/M/unsubscribe.  
  27. # 当安全级别为D, E, W, N, I, M分别对应为调试, 错误, 警告, 注意, 信息, 消息.  
  28. # 消息安全类型用于订阅/取消订阅的消息类型时,发送的日志信息保存在  
  29. # $SYS/broker/log/M/susbcribe or $SYS/broker/log/M/unsubscribe  
  30. #  
  31. # The file destination requires an additional parameter which is the file to be  
  32. # logged to, e.g. "log_dest file /var/log/mosquitto.log". The file will be  
  33. # closed and reopened when the broker receives a HUP signal. Only a single file  
  34. # destination may be configured.  
  35. #  
  36. # Note that if the broker is running as a Windows service it will default to  
  37. # "log_dest none" and neither stdout nor stderr logging is available.  
  38. # Use "log_dest none" if you wish to disable logging.  
  39. log_dest file /var/log/mosquitto.log  
  40.   
  41. # If using syslog logging (not on Windows), messages will be logged to the  
  42. # "daemon" facility by default. Use the log_facility option to choose which of  
  43. # local0 to local7 to log to instead. The option value should be an integer  
  44. # value, e.g. "log_facility 5" to use local5.  
  45. #log_facility 5  
  46.   
  47. # Types of messages to log. Use multiple log_type lines for logging  
  48. # multiple types of messages.  
  49. # Possible types are: debug, error, warning, notice, information,   
  50. # none, subscribe, unsubscribe, websockets, all.  
  51. # Note that debug type messages are for decoding the incoming/outgoing  
  52. # network packets. They are not logged in "topics".  
  53. #log_type error  
  54. #log_type warning  
  55. #log_type notice  
  56. log_type all  
  57.   
  58. # Change the websockets logging level. This is a global option, it is not  
  59. # possible to set per listener. This is an integer that is interpreted by  
  60. # libwebsockets as a bit mask for its lws_log_levels enum. See the  
  61. #log_facility 5  
  62. # If using syslog logging (not on Windows), messages will be logged to the  
  63. # "daemon" facility by default. Use the log_facility option to choose which of  
  64. # local0 to local7 to log to instead. The option value should be an integer  
  65. # value, e.g. "log_facility 5" to use local5.  
  66.   
  67. # Types of messages to log. Use multiple log_type lines for logging  
  68. # multiple types of messages.  
  69. # Possible types are: debug, error, warning, notice, information,   
  70. # none, subscribe, unsubscribe, websockets, all.  
  71. #log_facility 5  
  72.   
  73. # Types of messages to log. Use multiple log_type lines for logging  
  74. # multiple types of messages.  
  75. # Possible types are: debug, error, warning, notice, information,   
  76. # none, subscribe, unsubscribe, websockets, all.  
  77. # Note that debug type messages are for decoding the incoming/outgoing  
  78. # network packets. They are not logged in "topics".  
  79. # where severity is one of D, E, W, N, I, M which are debug, error,   
  80. # warning, notice, information and message. Message type severity is used by  
  81. # the subscribe/unsubscribe log_types and publishes log messages to  
  82. # $SYS/broker/log/M/susbcribe or $SYS/broker/log/M/unsubscribe.  
  83. # 当安全级别为D, E, W, N, I, M分别对应为调试, 错误, 警告, 注意, 信息, 消息.  
  84. # 消息安全类型用于订阅/取消订阅的消息类型时,发送的日志信息保存在  
  85. # $SYS/broker/log/M/susbcribe or $SYS/broker/log/M/unsubscribe  
  86. #  
  87. # The file destination requires an additional parameter which is the file to be  
  88. # logged to, e.g. "log_dest file /var/log/mosquitto.log". The file will be  
  89. # closed and reopened when the broker receives a HUP signal. Only a single file  
  90. # destination may be configured.  
  91. #  
  92. # Note that if the broker is running as a Windows service it will default to  
  93. # "log_dest none" and neither stdout nor stderr logging is available.  
  94. # Use "log_dest none" if you wish to disable logging.  
  95. log_dest file /var/log/mosquitto.log  
  96.   
  97. # If using syslog logging (not on Windows), messages will be logged to the  
  98. # value, e.g. "log_facility 5" to use local5.  
  99. #  
  100. #log_facility 5  
  101.   
  102. # Types of messages to log. Use multiple log_type lines for logging  
  103. # multiple types of messages.  
  104. # in /var/log/messages or similar.  
  105. # syslog使用用户空间记录日志的级别通常保存在/var/log/messages或者邮件中  
  106. #  
  107. # topic logs to the broker topic '$SYS/broker/log/<severity>',   
  108. # 主题日志保存在代理服务器的主题日志路径下面 '$SYS/broker/log/<severity>'  
  109. #  
  110. # where severity is one of D, E, W, N, I, M which are debug, error,   
  111. # warning, notice, information and message. Message type severity is used by  
  112. # the subscribe/unsubscribe log_types and publishes log messages to  
  113. # $SYS/broker/log/M/susbcribe or $SYS/broker/log/M/unsubscribe.  
  114. # 当安全级别为D, E, W, N, I, M分别对应为调试, 错误, 警告, 注意, 信息, 消息.  
  115. # 消息安全类型用于订阅/取消订阅的消息类型时,发送的日志信息保存在  
  116. # $SYS/broker/log/M/susbcribe or $SYS/broker/log/M/unsubscribe  
  117. #  
  118. # The file destination requires an additional parameter which is the file to be  
  119. # logged to, e.g. "log_dest file /var/log/mosquitto.log". The file will be  
  120. # closed and reopened when the broker receives a HUP signal. Only a single file  
  121. # destination may be configured.  
  122. #  
  123. # Note that if the broker is running as a Windows service it will default to  
  124. # "log_dest none" and neither stdout nor stderr logging is available.  
  125. # Use "log_dest none" if you wish to disable logging.  
  126. log_dest file /var/log/mosquitto.log  
  127.   
  128. # If using syslog logging (not on Windows), messages will be logged to the  
  129. # "daemon" facility by default. Use the log_facility option to choose which of  
  130. # local0 to local7 to log to instead. The option value should be an integer  
  131. # value, e.g. "log_facility 5" to use local5.  
  132. #  
  133. #log_facility 5  
  134.   
  135. # Types of messages to log. Use multiple log_type lines for logging  
  136. # multiple types of messages.  
  137. # 设置日志保存的消息类型.使用多个log_type列对应多个日志的消息类型  
  138. # Possible types are: debug, error, warning, notice, information,   
  139. # none, subscribe, unsubscribe, websockets, all.  
  140. # 有效的类型:debug, error, warning, notice, information, none, suscribe, unsubscribe, websockets, all  
  141. # Note that debug type messages are for decoding the incoming/outgoing  
  142. # network packets. They are not logged in "topics".  
  143. # 注意:debug类型,消息会被解码为输入/输出的网络包,如果作为topics不会被记录到日志  
  144. #log_type error  
  145. #log_type warning  
  146. #log_type notice  
  147. log_type all  
  148.   
  149. # Change the websockets logging level. This is a global option, it is not  
  150. # possible to set per listener. This is an integer that is interpreted by  
  151. # libwebsockets as a bit mask for its lws_log_levels enum. See the  
  152. # libwebsockets documentation for more details. "log_type websockets" must also  
  153. # be enabled.  
  154. # 设置websockets的日志级别,是一个全局的选项,但不是每个监听器都生效  
  155. # 可以当做libwebsockets的位掩码的整数作为lws_log_level的枚举  
  156. # 通过libwebsockets文档查看详情  
  157. # ‘log_type websockets’ 必须设置为生效才能设置这个参数   
  158. #websockets_log_level 0  
  159.   
  160. # If set to true, client connection and disconnection messages will be included  
  161. #websockets_log_level 0  
  162.   
  163. # If set to true, client connection and disconnection messages will be included  
  164. # in the log.  
  165. # 是否保存客户端的连接和断开连接的信息到日志  
  166. connection_messages true  
  167.   
  168. # If set to true, add a timestamp value to each log message.  
  169. # 是否设置日志时间  
  170. log_timestamp true  

# =================================================================
# Logging
# =================================================================


# Places to log to. Use multiple log_dest lines for multiple 
# logging destinations.
# Places to log to. Use multiple log_dest lines for multiple 
# logging destinations.
# Possible destinations are: stdout stderr syslog topic file
#
# stdout and stderr log to the console on the named output.
#
# syslog uses the userspace syslog facility which usually ends up 
# in /var/log/messages or similar.
#
# topic logs to the broker topic '$SYS/broker/log/<severity>', 
# where severity is one of D, E, W, N, I, M which are debug, error, 
# warning, notice, information and message. Message type severity is used by
# the subscribe/unsubscribe log_types and publishes log messages to
# The file destination requires an additional parameter which is the file to be
# Note that if the broker is running as a Windows service it will default to
#log_dest stderr
log_dest file /var/log/mosquitto.log


# If using syslog logging (not on Windows), messages will be logged to the
# "daemon" facility by default. Use the log_facility option to choose which of
# local0 to local7 to log to instead. The option value should be an integer
# value, e.g. "log_facility 5" to use local5.
#log_facility


# Types of messages to log. Use multiple log_type lines for logging
# multiple types of messages.
# Possible types are: debug, error, warning, notice, information, 
# none, subscribe, unsubscribe, websockets, all.
# Note that debug type messages are for decoding the incoming/outgoing
# network packets. They are not logged in "topics".
#log_type error
#log_type warning
#log_type notice
#log_type information
log_type all


# Change the websockets logging level. This is a global option, it is not
# possible to set per listener. This is an integer that is interpreted by
# libwebsockets as a bit mask for its lws_log_levels enum. See the
# libwebsockets documentation for more details. "log_type websockets" must also
# be enabled.
#websockets_log_level 0


# If set to true, client connection and disconnection messages will be included
# in the log.
connection_messages true


# If set to true, add a timestamp value to each log message.
log_timestamp true


mosquitto配置文件详解 安装完成之后,所有配置文件会被放置于/etc/mosquitto/目录下,其中最重要的就是Mosquitto的配置文件,即mosquitto.conf,以下是详细的配置参数说明。 # Config file for mosquitto # # See mosquitto.conf(5) for more information. # # Default values are shown, uncomment to change. # # Use the # character to indicate a c 阅读详情

相关推荐

Seafile搭建以及onlyoffice在线办公

部署seafile docker-compose.yml 如下: 参考此篇文章 version: '2.0' services: db: image: mariadb:10.1 container_name: seafile-mysql environment: - MYSQL_ROOT_PASSWORD=db_dev # mysql root的密码,同时修改 seafile的DB_ROOT_PASSWD与这个一致 - MYSQL_LOG_CONSOLE

dwdcth的专栏 4656

Mosquitto日志管理

项目中使用Mosquitto作为MQTT服务器,在mosquitto.conf配置文件中设置了日志的输出。然而几天过去后日志文件已经变得相当庞大,很不利于查看日志分析问题。故此,想着日志是否可以按照天来存储,查看Mosquitto官网和大量其他关于日志配置的博客后没有发现解决办法,后来无意中看到一篇介绍logrotate的文章,问题解决。 logrotate logrotate是Linux系统自带...

大丁的博客 5991

深入解析WIFI与蓝牙模块电路设计:从原理到实战

本文深入解析了WIFI与蓝牙模块的电路设计,从核心原理到实战应用。文章以AP6256模块为例,详细拆解了电源树、时钟电路、接口设计及天线射频路径等关键环节,并提供了PCB布局布线的实用准则与调试方法,旨在帮助硬件工程师设计出稳定可靠的无线产品,规避常见陷阱。

weixin_29186249的博客 150

Mosquitto服务器的日志分析

启动Mosquitto后,我们可以看到Mosquitto的启动日志: 1515307521: mosquitto version 1.4.12 (build date 2017-06-01 13:03:46+0000) starting 1515307521: Config loaded from /mosquitto/conf/mosquitto.conf. 15153075...

weixin_30294295的博客 918

《遥感大模型生产级实战:从数据到决策的端到端AI工程》系列第一部分:AI遥感工程师的基础设施与工具链-文章 4:传统遥感分析与机器学习基线

本章将系统性地介绍经典遥感分析工作流,从数据预处理到多维度特征工程,再到如何利用经典的机器学习模型(如随机森林、支持向量机)进行监督与非监督学习。我们将通过一个完整的“智慧农业作物分类”项目实战,展示如何利用我们之前构建的数据湖和工具链,从原始数据到最终的分析结果,构建一个性能可靠、可解释性强的基线系统。更重要的是,我们将深入剖析这种传统方法的局限性,从而为后续章节引入遥感大模型的必要性提供强有力的论证。

panshengwu的博客 705

ASF-YOLO:一种基于注意尺度序列融合的细胞实例分割YOLO模型

随着样本制备技术和显微成像技术的快速发展,细胞图像的定量处理和分析在医学、细胞生物学等领域发挥着重要作用。基于卷积神经网络(CNN),可以通过神经网络训练学习不同细胞图像的特征信息,具有很强的泛化性能。两阶段的R-CNN系列[1,2,3]及其一阶段变体[4,5]是实例分割任务的经典CNN基础框架。在最近的研究中,You Only Look Once(YOLO)系列[6,7,8,9]已经成为实时实例分割中速度最快、最准确的模型之一。

m0_47867638的博客 9800

mosquitto查看订阅记录_Mosquitto服务器日志分析总结

Mosquitto服务器日志分析总结客户端连接日志1403334375: New connection from 121.201.8.163 on port 1883.1403334375: New client connected from 121.201.8.163 as zhoujing (c0, k60, ujoyo).1403334375: Sending CONNACK to zhou...

weixin_33642448的博客 1435

LwIP在国产MCU的落地实践:从协议栈优化到网络稳定性实战

本文详细介绍了LwIP协议栈在国产GD32F407 MCU上的移植与优化实践,涵盖硬件平台选择、驱动适配、协议栈调优和网络稳定性提升策略。通过内存管理优化、实时操作系统集成和性能测试,为工业物联网应用提供高可靠性网络通信解决方案,显著提升数据传输效率和系统稳定性。

m2n3b4v5c6的博客 270

Mosquitto服务器日志分析总结

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34337265的博客 627

手把手教你学Simulink——机器人力控场景实例:基于Simulink的永磁同步电机重力补偿力矩控制仿真

本文介绍了基于Simulink的机器人重力补偿力矩控制仿真方法。针对机器人悬停时电机发热、抖动等问题,提出通过前馈补偿重力转矩的解决方案。文章详细阐述了从机器人动力学建模、重力补偿计算、PMSM转矩控制到系统集成的完整实现流程,并以2-DOF机械臂为例验证了补偿效果。结果表明,重力补偿能显著降低电机电流和拖拽力,提高系统柔顺性。文中还提供了高级功能扩展方向,如参数辨识、摩擦补偿等,为实际工程应用提供了参考框架。

MHD0815的博客 154

最全的Hermes安装教程以及Hermes WebUI安装部署和配置指南

* 直接执行命令**

小石头的专栏 1074

mosquitto查看订阅记录_Mosquitto配置----日志设置

https://blog.youkuaiyun.com/u012377333/article/details/71101725# =================================================================# Logging# 日志信息# ===========================================================...

weixin_31325725的博客 1438

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

mosquitto-1.6.7设置运行日志记录配置如下

mosquitto-1.6.7设置运行日志记录配置如下

HardProgrammer的博客 960

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

转:Mosquitto配置----日志设置

1.mosquitto的日志输出方式简介 mosquitto是一个纯C的代码,它的日志输出支持若干中日志输出方式,通过修改配置项:log_dest即可完成对各种日志输出类型的切换,常见的日志输出类型有有下几种: (1)控制台输出stdout、stderrr log_dest stderr (2)输出到日志文档 log_dest file /home/logs/mosquitto/mo...

weixin_30484247的博客 538

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

mosquitto oracle,mosquitto配置文件/etc/mosquitto/mosquitto.conf配置参数详细说明

1 mosquitto配置文件/etc/mosquitto/mosquitto.conf配置参数详细说明23 2018年09月07日 09:42:30 jacklin_001 阅读数:4124 # =================================================================5 # General configuration6 # =======...

weixin_34777998的博客 315

Mosquitto配置文件说明

为什么80%的码农都做不了架构师?>>> ...

weixin_34162695的博客 189

mosquitto - 笔记

1 mosquitto心跳和网络重连机制(基于MQTT协议)mosquitto心跳和网络重连机制(基于MQTT协议)_mqtt重连机制-优快云博客2. mosquitto简单应用https://www.cnblogs.com/embedded-linux/p/9386169.html

tianyu的专栏 - Linux site:blog.youkuaiyun.com/wishfly 528

Mosquitto之配置文件解析

本篇文章将解释mosquitto.conf文件中部分参数的意义,以方便理解和部署mosquitto。初次使用,难免出现错误,欢迎批评指正。 备注:mosquitto.conf配置文件以 '#' 作为注释。 基本相关 per_listener_settings:按监听配置。mosquitto具备一个默认的listener,称为默认监听端口,同时还可以配置多个listener,一个list...

haohaoge_jx的专栏 3279

mosquitto.conf之log配置

# ================================================================= # Logging # 日志信息 # ================================================================= # Places to log to. Use multiple log_de...

weixin_34064653的博客 1298

关于 MQTT Mosquitto工具的安装、使用、配置

关于 MQTT Mosquitto工具的安装、使用、配置官网安装使用使用 指令:发布/订阅配置日志匿名权限 官网 官网地址 其实很多东西官网都有,只不过是英文文档,需要大家有一定的英文文献阅读水平。但是呢,现在翻译软件也很厉害,虽然翻译的不是特别的专业,有时候还有点拗口,但是慢慢去读,还是可以理解的。 安装 在官网上面有较为详细的安装教程,各个环境都有,大家可以根据自己的实际情况去使用。 下面简单来说一下 Ubuntu 的环境下如何安装 这个Mosquitto。 1、首先添加到存储库列表 sudo apt-

weixin_42074504的博客 1371

mosquitto配置文件/etc/mosquitto/mosquitto.conf配置参数详细说明

mosquitto配置文件/etc/mosquitto/mosquitto.conf配置参数详细说明 摘自:https://blog.youkuaiyun.com/weixin_43025071/article/details/82491560 1 mosquitto配置文件/etc/mosquitto/mosquitto.conf配置参数详细说明 2 3 2018年09...

weixin_30767921的博客 686

MQTT--Mosquitto的配置文件

Mosquitto的配置文件存放在/etc/mosquitto/mosquitto.conf 配置文件具体的配置内容为: # ================================================================= # General configuration # ============================================...

weixin_33801856的博客 643
上一篇: 本软件基于云盘万能钥匙API开发
下一篇: 1527070286: Error: Unable to open log file /var/log/mosquitto.log for writing. 问题解决
王树民
博客等级 码龄10年 912粉丝 560原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值