mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
(MAINT) Add optional API Request Logging
This was partially an exercise to use middleware, but also to enable basic logging for the API by logging all the API calls to the logger.
This commit is contained in:
parent
a21d8c5642
commit
85ff3f7022
17 changed files with 85 additions and 24 deletions
|
|
@ -9,7 +9,7 @@ module Vmpooler
|
|||
# Load dashboard components
|
||||
require 'vmpooler/dashboard'
|
||||
|
||||
def self.execute(torun, config, redis, metrics)
|
||||
def self.execute(torun, config, redis, metrics, logger)
|
||||
self.settings.set :config, config
|
||||
self.settings.set :redis, redis unless redis.nil?
|
||||
self.settings.set :metrics, metrics
|
||||
|
|
@ -43,6 +43,9 @@ module Vmpooler
|
|||
end
|
||||
|
||||
if torun.include? :api
|
||||
# Enable API request logging only if required
|
||||
use Vmpooler::API::RequestLogger, logger: logger if config[:config]['request_logger']
|
||||
|
||||
use Vmpooler::Dashboard
|
||||
use Vmpooler::API::Dashboard
|
||||
use Vmpooler::API::Reroute
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue