7

Is there any way to prevent PINGREQ and PINGRESP to be logged, keeping all other log_type(s) active?

I'm looking for a way to prevent only ping entries to be logged.

Here is my mosquitto.conf:

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest syslog
log_type all

connection_messages true
log_timestamp true

include_dir /etc/mosquitto/conf.d
3
  • 3
    Update the question to show all the logging config options you have (and what cmd line args you are using)
    – hardillb
    Jun 15, 2017 at 6:25
  • 2
    Also the default logging level shows connection messages but not ping messages iirc
    – hardillb
    Jun 15, 2017 at 6:52
  • 1
    @hardillb thanks for the suggestion; I've just added conf file, I actually not using any commands, just found those annoying PINGx entries while inspecting the logs in journalctl
    – Dario
    Jun 16, 2017 at 2:48

1 Answer 1

3

Remove the following from the config file:

log_type all
4
  • 1
    That would only leave with the default log types. I just want to avoid pings
    – Dario
    Jun 16, 2017 at 13:50
  • 2
    That's not the question you asked, You asked to keep connection messages and not have pings, removing that line will give you that. Have you tried the other logging levels (debug, error, warning, notice, information, subscribe, unsubscribe) to see if they give the mix you want?
    – hardillb
    Jun 16, 2017 at 13:55
  • 1
    Sorry, I shouldn't mention connection_messages as the only thing to keep in the config. I hope yo don't mind me to rephrase the question. I've upvoted your answer, btw
    – Dario
    Jun 16, 2017 at 14:26
  • 1
    be removing log_type debug and leaving all others, PINGs are no longer logged. May be that's the best I can do, even when I just wanted to leave pings out. Thanks
    – Dario
    Jun 16, 2017 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.