smarthomeNG/smarthome

admin interface: Warning after changing plugin loglevel

aschwith opened this issue · 8 comments

Changing a plugin loglevel via the admin interface -> logs -> logger list sucessfully changes the according log level but triggers a warning:

WARNING modules.admin.api_loggers REST_dispatch_execute: plugins.xyz: 'LoggersController' object has no attribute 'create_backupfile'

wvhn commented

the same happens after a change in modules logger.

msinn commented

@aschwith Do you have more details? I cannot reproduce it (running the develop branch)
@onkelandy I can't reproduce that either.

Changeing a logger's level, I get the following log entries, but no WARNING:

2023-02-05  14:53:36 NOTICE   modules.admin.api_loggers set_active_logger_level(): logger=lib.module, level=INFO
2023-02-05  14:53:36 NOTICE   modules.admin.api_loggers set_active_logger_level(): lg=<Logger lib.module (NOTICE)>, lglevel=20
2023-02-05  14:53:36 NOTICE   modules.admin.api_loggers load_logging_config: shng_version=x
2023-02-05  14:53:36 NOTICE   modules.admin.api_loggers  - old level=NOTICE

Think you wanted to mention @wvhn ..?
I don't have any issues when changing the log level with most recent develop branch.

wvhn commented

I noticed the issue on master branch v1.9.3. Haven't tested yet on develop.

Same for me: Issue occurs in Master v1.9.3. Did not doublecheck current develop version.

msinn commented

I couldn't find it at first, because it only happens if the etc/logging.yaml hasn't been changed by the admin interface before. In this case SmartHomeNG tries to create a backup file before writing the new configuration to disk.

Since the error occurred for you, the new configuration wasn't written to disk.

It will be fixed in the next release.

msinn commented

SmartHomeNG v1.9.4 has been released

Issue no longer occurs under v1.9.4. Thanks for fixing.