I would like an option to turn this
[active_model_serializers] Rendered ActiveModel::Serializer::CollectionSerializer with ActiveModelSerializers::Adapter::JsonApi (136.7ms)
log message of.
@MSathieu Of course. We should reference that in docs/general/logging.md along with the log subscriber and active support notifications api.
It's unclear to me if you want to
ActiveModelSerializers.logger = Logger.new(IO::NUL) or ActiveModelSerializers.logger = Logger.new(nil) ActiveSupport::Notifications.unsubscribe(ActiveModelSerializers::Logging::RENDER_EVENT)ActiveSupport::LogSubscriber.log_subscribers.delete_if {|subscriber| subscriber.instance_of?(ActiveModelSerializers::Logging::LogSubscriber) } though I haven't tried these myself.
I want to set ActiveModelSerializers.logger = Logger.new(nil)
@MSathieu did that resolve your issue?
@bf4 ActiveModelSerializers.logger = Logger.new(nil) doesn't works,
ActiveModelSerializers.logger = Logger.new(IO::NUL) raises an error,
but ActiveSupport::Notifications.unsubscribe(ActiveModelSerializers::Logging::RENDER_EVENT) works perfectly
@MSathieu Would you like to make a PR to improve the docs, especially based on how you went about looking for the info?
I will do that.
Most helpful comment
@bf4
ActiveModelSerializers.logger = Logger.new(nil)doesn't works,ActiveModelSerializers.logger = Logger.new(IO::NUL)raises an error,but
ActiveSupport::Notifications.unsubscribe(ActiveModelSerializers::Logging::RENDER_EVENT)works perfectly