Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mosquitto add-on verbose logging #2022

Closed
b3nj1 opened this issue May 20, 2021 · 3 comments
Closed

Mosquitto add-on verbose logging #2022

b3nj1 opened this issue May 20, 2021 · 3 comments

Comments

@b3nj1
Copy link
Contributor

b3nj1 commented May 20, 2021

Hi,
The mosquitto logging level has been increased (again). Back in PR #1708, we used the system logging level into the mosquitto logging level, but this has been removed in #2007.

I'd like to submit a PR to address this, but first, @frenck, was the unconfigurable logging level change intentional for some reason. If it was intentional, is there a preferred way to make it configurable over the way we had it below?

New template log level:

Old code to set logging level based on configured level:

if [ "${LOGGING}" == "debug" ]; then
sed -i "s/%%AUTH_QUIET_LOGS%%/false/g" /etc/mosquitto.conf
else
sed -i "s/%%AUTH_QUIET_LOGS%%/true/g" /etc/mosquitto.conf
if [ "${LOGGING}" == "critical" ] || [ "${LOGGING}" == "fatal" ] || [ "${LOGGING}" == "error" ]; then
sed -i -e "s/^log_type warning//" -e "s/^log_type notice//" -e "s/^log_type information//" /etc/mosquitto.conf
elif [ "${LOGGING}" == "warning" ] || [ "${LOGGING}" == "warn" ]; then
sed -i -e "s/^log_type notice//" -e "s/^log_type information//" /etc/mosquitto.conf
fi
fi

Thanks,

  • Benjamin
@frenck
Copy link
Member

frenck commented May 20, 2021

There is not need to do that or add such logic. If you want to override settings on that level, the customization feature is available. That would allow you to write about any option to mosquitto.

@b3nj1
Copy link
Contributor Author

b3nj1 commented May 20, 2021

@frenck , the log_type conf is additive, so I believe I can't "remove" the settings that were applied in the add-on's supplied configuration. Do you mind if we remove the log_type settings from the add-on config?

Thanks for the pointer on the customization! It's a nice method in general.

  • Benjamin

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants