How to change log time format Mosquitto broker?

I am unable to find information/documentation on how to change log time format for the Mosquitto Add-in. This is how it looks like for me:

This is my settings:

I guess there is a mix in the current time format(s), epoch time + human readable? Where is the settings for human readable only?

Mosquitto version: 5.1.1

There is no setting for this that I know of. You could add a feature request for it.

in ssh

docker logs addon_core_mosquitto|perl -pe 's/(\d+)/localtime($1)/e'
3 Likes

I am running my Home Assistant under Home Assistant Operating System. Is it the same command here as well?

Install the Portainer addon and use it’s bash shell for the Mosquitto container?

You will have to do this after every update. Better to request it get fixed in the addon.

Great suggestion! Unfortunately I am not very familiar with Docker/Portainer yet and therefore a bit afraid of messing things up with my Home Assistant installation doing things I am not 100% sure of. I will go for the request!

Thanks for great help @nickrout and @tom_l !

1 Like

you can’t ruin anything with my suggestion, but it as a little inconvenient.

yes that is the place to type it.

1 Like

Have a look at this thread How to modify mosquitto.conf? - #4 by 123 - particularly the last post. I think this is how I permanently changed the log file date format for mosquitto - though it was a while ago, so I hope things haven’t changed.

Hope this helps.

2 Likes

That worked perfectly. Thanks!

Unfortunately that didn’t help me.

I created the file /share/mosquitto/mosquitto.conf and put the configuration content in it (from your linked post). After that, I restarted the Mosquitto Add-in.

Here is the log output:
image

I’m absolutely not an expert, but my Add-in seemed to expect another config, /etc/mosquitto.conf ?

The strange thing is that when I tried to reach that file from VS Code Add-in, /etc/mosquitto.conf wasn’t there. I guess there is something I do not fully understand here?

I followed the instructions in the last post in that topic. I put the file here:

/share/mosquitto/mosquitto.conf

I did the same as you, but my outcome seems to be different (I followed the instructions in the last post as well). Strange

Make sure the mosquitto.conf file is in unix format (Lf EOL not CrLf EOL).

Also check your addon log:

I abandoned the VS Code Add-on and used nano in the Terminal SSH Add-on.

  1. I am in the folder /share/mosquitto:

  2. I verify the content in mosquitto.conf by typing nano mosquitto.conf:

  3. I restart the Mosquitto Add-on:

  4. This is the result

So no, sorry! The linked post is not a solution to my problem.

Did you set the active: and folder: options?

1 Like

Do you mean to anything different than the “default” values? In that case, no. This picture is from my initial post:


What should it be?

You need to do so, and please don’t post screenshots of text configuration. Cut and paste has been around at least 30 years.