diff --git a/plugins/commands/serve/util/exception_logger.rb b/plugins/commands/serve/util/exception_logger.rb index a8790020f..15c7d5222 100644 --- a/plugins/commands/serve/util/exception_logger.rb +++ b/plugins/commands/serve/util/exception_logger.rb @@ -4,7 +4,13 @@ module VagrantPlugins # Adds exception logging to all public instance methods module ExceptionLogger def self.included(klass) - klass.public_instance_methods.each do |m_name| + # Get all the public instance methods. Need to search ancestors as well + # for modules like the Guest service which includes the CapabilityPlatform + # module + klass_public_instance_methods = klass.public_instance_methods + # Remove all generic instance methods from the list of ones to modify + logged_methods = klass_public_instance_methods - Object.public_instance_methods + logged_methods.each do |m_name| klass.define_method(m_name) do |*args, **opts, &block| begin super(*args, **opts, &block)