music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.36k stars 52 forks source link

Server: Log level settings not taking effect #1477

Closed krisnoble closed 11 months ago

krisnoble commented 1 year ago

What version of Music Assistant has the issue?

Server 2.0.0b72 (Docker)

The problem

I'm having issues with my logs filling up with info-level logs from unavailable metadata etc. I've tried setting the log level of the metadata controller to be less verbose, first to warning and then to error (indeed, I think all my logs are currently set to error) but nothing has changed in the log output.

Additional question - I see there's a global setting for logs, but I don't see where to change that, is there somewhere I'm missing?

How to reproduce

  1. Set log level for a core module to error
  2. Check the logs and see that the logs are still outputting lower levels e.g. info

Relevant log output

2023-08-16 20:07:25.389 INFO (MainThread) [music_assistant.metadata] Unable to get musicbrainz ID for artist Anjunadeep
 - using lookup-album(s): Anjunadeep The Yearbook 2020/Anjunadeep The Yearbook 2020
 - using lookup-track(s): none

Additional information

No response

What version of Home Assistant Core are your running

2023.8.x

What type of installation are you running?

Home Assistant Container

On what type of hardware are you running?

Raspberry Pi

OzGav commented 1 year ago

I assume you mean the metadata controller you have changed the logging for? Try the Musicbrainz provider instead. Better yet tag those tracks with the MB IDs. I see Anjunadeep is in the MB database. As for where the global setting is I’m not sure.

krisnoble commented 1 year ago

Try the Musicbrainz provider instead

Those are all already set to error unfortunately. It's not just the metadata, I'm getting info-level logs for everything it seems, despite the log settings all being error.

Better yet tag those tracks with the MB IDs.

That is the medium term goal but I have a lot of tracks that would need tagging - the joy of trying to reconcile a vast collection coalesced over many years from many sources 😅

Here's my settings.json, you can see all logs are set to ERROR:

{
  "server_id": "[redacted]",
  "providers": {
    "chromecast": {
      "values": {
        "log_level": "ERROR"
      },
      "type": "player",
      "domain": "chromecast",
      "instance_id": "chromecast",
      "enabled": false,
      "name": "Chromecast",
      "last_error": null
    },
    "airplay": {
      "values": {
        "log_level": "ERROR"
      },
      "type": "player",
      "domain": "airplay",
      "instance_id": "airplay",
      "enabled": false,
      "name": "Airplay",
      "last_error": null
    },
    "dlna": {
      "values": {
        "log_level": "ERROR"
      },
      "type": "player",
      "domain": "dlna",
      "instance_id": "dlna",
      "enabled": false,
      "name": "UPnP/DLNA Player provider",
      "last_error": null
    },
    "sonos": {
      "values": {
        "log_level": "ERROR"
      },
      "type": "player",
      "domain": "sonos",
      "instance_id": "sonos",
      "enabled": false,
      "name": "SONOS",
      "last_error": null
    },
    "url": {
      "values": {
        "log_level": "ERROR"
      },
      "type": "music",
      "domain": "url",
      "instance_id": "url",
      "enabled": true,
      "name": "URL",
      "last_error": null
    },
    "slimproto": {
      "values": {
        "log_level": "ERROR"
      },
      "type": "player",
      "domain": "slimproto",
      "instance_id": "slimproto",
      "enabled": true,
      "name": "Slimproto",
      "last_error": null
    },
    "fanarttv": {
      "values": {
        "log_level": "ERROR"
      },
      "type": "metadata",
      "domain": "fanarttv",
      "instance_id": "fanarttv",
      "enabled": true,
      "name": "fanart.tv Metadata provider",
      "last_error": null
    },
    "musicbrainz": {
      "values": {
        "log_level": "ERROR"
      },
      "type": "metadata",
      "domain": "musicbrainz",
      "instance_id": "musicbrainz",
      "enabled": true,
      "name": "MusicBrainz Metadata provider",
      "last_error": null
    },
    "theaudiodb": {
      "values": {
        "log_level": "ERROR"
      },
      "type": "metadata",
      "domain": "theaudiodb",
      "instance_id": "theaudiodb",
      "enabled": true,
      "name": "TheAudioDB Metadata provider",
      "last_error": null
    },
    "ugp": {
      "values": {
        "ugp_1": [
          [redacted]
        ],
        "log_level": "ERROR"
      },
      "type": "player",
      "domain": "ugp",
      "instance_id": "ugp",
      "enabled": true,
      "name": "Universal Group Player",
      "last_error": null
    },
    "filesystem_local": {
      "values": {
        "path": "/Music",
        "missing_album_artist_action": "track_artist",
        "log_level": "ERROR"
      },
      "type": "music",
      "domain": "filesystem_local",
      "instance_id": "filesystem_local",
      "enabled": true,
      "name": "Filesystem (local disk)",
      "last_error": null
    },
    "radiobrowser": {
      "values": {
        "log_level": "ERROR"
      },
      "type": "music",
      "domain": "radiobrowser",
      "instance_id": "radiobrowser",
      "enabled": true,
      "name": "RadioBrowser",
      "last_error": null
    }
  },
  "players": {
    [redacted]
  },
  "core": {
    "music": {
      "values": {
        "sync_interval": 60,
        "log_level": "ERROR"
      },
      "domain": "music",
      "last_error": null
    },
    "metadata": {
      "values": {
        "log_level": "ERROR"
      },
      "domain": "metadata",
      "last_error": null
    },
    "webserver": {
      "values": {
        "log_level": "ERROR"
      },
      "domain": "webserver",
      "last_error": null
    },
    "player_queues": {
      "values": {
        "log_level": "ERROR"
      },
      "domain": "player_queues",
      "last_error": null
    },
    "players": {
      "values": {
        "log_level": "ERROR"
      },
      "domain": "players",
      "last_error": null
    },
    "streams": {
      "values": {
        "log_level": "ERROR"
      },
      "domain": "streams",
      "last_error": null
    }
  }
}
OzGav commented 1 year ago

Ok thanks. This will get looked at.

OzGav commented 1 year ago

Still looking but the global setting is set on the addon configuration page

OzGav commented 1 year ago

Please check the global logging level on the addon page. If that is set at a more verbose level then I think it might override a less verbose level on the individual component

OzGav commented 1 year ago

Just need some followup here or we will close this

krisnoble commented 1 year ago

Sorry, this one slipped through the net. Need a bit more time to test properly, seems like global may always be taking precedence regardless of relative verbosity based on a very quick test in the last few minutes. Could just be coincidence though so will test more thoroughly.

Side note regarding the global log setting - if it's only on the add-on config page then I guess there'd need to be some way added to the UI for Docker users to be able to change it?

OzGav commented 1 year ago

Thanks for the report in a future update the following will be addressed

OzGav commented 11 months ago

This should be fixed in beta 75. Let us know if not.

krisnoble commented 11 months ago

Seems mostly fixed thanks but might need another tweak - I'm still getting warning-level messages from the webserver component with global set to warning and webserver set to error. Think that's the only one I've seen not behaving itself since updating though 👍🏻

OzGav commented 11 months ago

Can you open a new issue for that? Thanks.