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  

猜你喜欢

转载自www.cnblogs.com/saryli/p/9815814.html