生活随笔
收集整理的這篇文章主要介紹了
Mosquitto配置----日志设置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
版權聲明:歡迎大家轉載,轉載請聲明轉載地址http://blog.csdn.net/u012377333,謝謝大家。
[plain]?view plaincopy
#?=================================================================?? #?Logging?? #?日志信息?? #?=================================================================?? ?? #?Places?to?log?to.?Use?multiple?log_dest?lines?for?multiple??? #?logging?destinations.?? #?記錄日志,使用多個log_dest行對應多個日志信息的描述?? #?? #?Possible?destinations?are:?stdout?stderr?syslog?topic?file?? #?log_dest可能的選項有:?stdout?stderr?syslog?topic?file?? #?? #?stdout?and?stderr?log?to?the?console?on?the?named?output.?? #?stdout和stderr的日志輸出在控制臺?? #?? #?syslog?uses?the?userspace?syslog?facility?which?usually?ends?up??? #?in?/var/log/messages?or?similar.?? #?syslog使用用戶空間記錄日志的級別通常保存在/var/log/messages或者郵件中?? #?? #?topic?logs?to?the?broker?topic?'$SYS/broker/log/<severity>',??? #?主題日志保存在代理服務器的主題日志路徑下面?'$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?? #?$SYS/broker/log/M/susbcribe?or?$SYS/broker/log/M/unsubscribe.?? #?當安全級別為D,?E,?W,?N,?I,?M分別對應為調試,?錯誤,?警告,?注意,?信息,?消息.?? #?消息安全類型用于訂閱/取消訂閱的消息類型時,發送的日志信息保存在?? #?$SYS/broker/log/M/susbcribe?or?$SYS/broker/log/M/unsubscribe?? #?? #?The?file?destination?requires?an?additional?parameter?which?is?the?file?to?be?? #?logged?to,?e.g.?"log_dest?file?/var/log/mosquitto.log".?The?file?will?be?? #?closed?and?reopened?when?the?broker?receives?a?HUP?signal.?Only?a?single?file?? #?destination?may?be?configured.?? #?? #?Note?that?if?the?broker?is?running?as?a?Windows?service?it?will?default?to?? #?"log_dest?none"?and?neither?stdout?nor?stderr?logging?is?available.?? #?Use?"log_dest?none"?if?you?wish?to?disable?logging.?? 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?5?? ?? #?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?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?? #log_facility?5?? #?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.?? ?? #?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.?? #log_facility?5?? ?? #?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".?? #?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?? #?$SYS/broker/log/M/susbcribe?or?$SYS/broker/log/M/unsubscribe.?? #?當安全級別為D,?E,?W,?N,?I,?M分別對應為調試,?錯誤,?警告,?注意,?信息,?消息.?? #?消息安全類型用于訂閱/取消訂閱的消息類型時,發送的日志信息保存在?? #?$SYS/broker/log/M/susbcribe?or?$SYS/broker/log/M/unsubscribe?? #?? #?The?file?destination?requires?an?additional?parameter?which?is?the?file?to?be?? #?logged?to,?e.g.?"log_dest?file?/var/log/mosquitto.log".?The?file?will?be?? #?closed?and?reopened?when?the?broker?receives?a?HUP?signal.?Only?a?single?file?? #?destination?may?be?configured.?? #?? #?Note?that?if?the?broker?is?running?as?a?Windows?service?it?will?default?to?? #?"log_dest?none"?and?neither?stdout?nor?stderr?logging?is?available.?? #?Use?"log_dest?none"?if?you?wish?to?disable?logging.?? log_dest?file?/var/log/mosquitto.log?? ?? #?If?using?syslog?logging?(not?on?Windows),?messages?will?be?logged?to?the?? #?value,?e.g.?"log_facility?5"?to?use?local5.?? #?? #log_facility?5?? ?? #?Types?of?messages?to?log.?Use?multiple?log_type?lines?for?logging?? #?multiple?types?of?messages.?? #?in?/var/log/messages?or?similar.?? #?syslog使用用戶空間記錄日志的級別通常保存在/var/log/messages或者郵件中?? #?? #?topic?logs?to?the?broker?topic?'$SYS/broker/log/<severity>',??? #?主題日志保存在代理服務器的主題日志路徑下面?'$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?? #?$SYS/broker/log/M/susbcribe?or?$SYS/broker/log/M/unsubscribe.?? #?當安全級別為D,?E,?W,?N,?I,?M分別對應為調試,?錯誤,?警告,?注意,?信息,?消息.?? #?消息安全類型用于訂閱/取消訂閱的消息類型時,發送的日志信息保存在?? #?$SYS/broker/log/M/susbcribe?or?$SYS/broker/log/M/unsubscribe?? #?? #?The?file?destination?requires?an?additional?parameter?which?is?the?file?to?be?? #?logged?to,?e.g.?"log_dest?file?/var/log/mosquitto.log".?The?file?will?be?? #?closed?and?reopened?when?the?broker?receives?a?HUP?signal.?Only?a?single?file?? #?destination?may?be?configured.?? #?? #?Note?that?if?the?broker?is?running?as?a?Windows?service?it?will?default?to?? #?"log_dest?none"?and?neither?stdout?nor?stderr?logging?is?available.?? #?Use?"log_dest?none"?if?you?wish?to?disable?logging.?? 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?5?? ?? #?Types?of?messages?to?log.?Use?multiple?log_type?lines?for?logging?? #?multiple?types?of?messages.?? #?設置日志保存的消息類型.使用多個log_type列對應多個日志的消息類型?? #?Possible?types?are:?debug,?error,?warning,?notice,?information,??? #?none,?subscribe,?unsubscribe,?websockets,?all.?? #?有效的類型:debug,?error,?warning,?notice,?information,?none,?suscribe,?unsubscribe,?websockets,?all?? #?Note?that?debug?type?messages?are?for?decoding?the?incoming/outgoing?? #?network?packets.?They?are?not?logged?in?"topics".?? #?注意:debug類型,消息會被解碼為輸入/輸出的網絡包,如果作為topics不會被記錄到日志?? #log_type?error?? #log_type?warning?? #log_type?notice?? 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的日志級別,是一個全局的選項,但不是每個監聽器都生效?? #?可以當做libwebsockets的位掩碼的整數作為lws_log_level的枚舉?? #?通過libwebsockets文檔查看詳情?? #?‘log_type?websockets’?必須設置為生效才能設置這個參數??? #websockets_log_level?0?? ?? #?If?set?to?true,?client?connection?and?disconnection?messages?will?be?included?? #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配置----日志设置的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。