httplog
httplog copied to clipboard
Allow/block the logging on runtime
Hi there,
I would like to toggle certain URLs without restarting my app server.
I have a admin panel to enable/disable logging for certain URLs and we would like to do that in runtime, maybe allowing a block in the whitelist/blacklist pattern?
HttpLog.configure do |config|
config.url_whitelist_pattern = lambda do
Regexp.union(AdminVendor.pluck(:endpoint).map { Regexp.escape _1 })
end
end
I'm monkey patching right now to make it work:
class HttpLog::Configuration
def url_whitelist_pattern
Regexp.union(AdminVendor.pluck(:endpoint).map { Regexp.escape _1 })
end
end
But it would to be nice to have it officially :)
Happy to accept a pull request, with tests
Will do!