eclipse-mosquitto / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
9.1k stars 2.4k forks source link

can't find log files mac docker image #1495

Open hjw opened 5 years ago

hjw commented 5 years ago

I cannot find any logging files/ messages

my run command is:

docker run -itd --name="mosq" \
   -p 1883:1883 -p 9001:9001 \
   -v /Users/hjw/data/mqtt_docker/log:/mosquitto/log \
   -v /Users/hjw/data/mqtt_docker/mosquitto.conf:/mosquitto.conf \
    eclipse-mosquitto

my mosquitto.config (~/data/mqtt_docker/mosquitto.conf) is

# local mosquitto config file

#persistence true
#persistence_location /mosquitto/data

log_dest file /mosquitto/log/mosquitto.log

log_type error
log_type warning
log_type information

#log_dest stdout
#log_type all
#connection_messages true

I've opened up write permissions for all on the bound log directory. I've tried with a blank mosquitto.log file in that directory, making sure the permissions were open. I've tried docker exec -it mosq sh and looking in the /mosquitto/log directory as well as the /var/log directory, but, I have never been able to find any log message files in any of these places. The mosquitto.config file does show up inside the container and I have been able to create and see files within the log directory ... ones created from home machine show up inside container and vice-versa. I'm stuck and don't see any place to ask this type of question other then here. Hoping some one can help

jdwhite commented 3 years ago

You mention mosquitto.config a couple places, but mosquitto is looking for mosquitto.conf (no -ig suffix). What's your config file actually named? The other thing I see is that you're mapping mosquitto.conf to /mosquitto.conf in the container, but should be mapped to /mosquitto/config/mosquitto.conf in the container.