Can we get session data in log tags?

Hi, I have a rails 7 web app, which uses redis, hiredis, redis-actionpack to store session data. We also use devise for auth. Now, I wish to use log tags to include user_id in every line the logger logs. Is there a way to do this without me having to call redis.get directly and working with Marshal?

Earlier when we weren’t using redis store, we used cookie store - the default thing. We had this working, which obviously broke once we moved to redis -

   # Prepend all log lines with the following tags.
    config.log_tags = [:request_id, proc do |req|
      session_key = Rails.application.config.session_options[:key]
      session_data = req.cookie_jar.encrypted[session_key]
      if session_data.present?
        warden_data = session_data['warden.user.user.key']
        "user_id: #{warden_data[0][0]}" if warden_data.present?
      end
    end]