MDL-44596 logging: Refecator code to use component_callback() and get_plugin_list_with_function()