lib/foreman_tasks/dynflow/configuration.rb in foreman-tasks-0.7.1 vs lib/foreman_tasks/dynflow/configuration.rb in foreman-tasks-0.7.2
- old
+ new
@@ -1,15 +1,8 @@
module ForemanTasks
class Dynflow::Configuration
- # for logging action related info (such as exceptions raised in side
- # the actions' methods
- attr_accessor :action_logger
-
- # for logging dynflow related info about the progress of the execution etc.
- attr_accessor :dynflow_logger
-
# the number of threads in the pool handling the execution
attr_accessor :pool_size
# the size of db connection pool
attr_accessor :db_pool_size
@@ -33,20 +26,29 @@
# no effect. Useful for testing, where we mignt not want to execute
# the orchestration tied to the models.
attr_accessor :disable_active_record_actions
def initialize
- self.action_logger = Rails.logger
- self.dynflow_logger = Rails.logger
self.pool_size = 5
self.db_pool_size = pool_size + 5
self.remote = Rails.env.production?
self.transaction_adapter = ::Dynflow::TransactionAdapters::ActiveRecord.new
self.eager_load_paths = []
self.lazy_initialization = !Rails.env.production?
self.rake_tasks_with_executor = %w[db:migrate db:seed]
@on_init = []
+ end
+
+ # for logging action related info (such as exceptions raised in side
+ # the actions' methods
+ def action_logger
+ Foreman::Logging.logger('foreman-tasks/action')
+ end
+
+ # for logging dynflow related info about the progress of the execution etc.
+ def dynflow_logger
+ Foreman::Logging.logger('foreman-tasks/dynflow')
end
def on_init(&block)
@on_init << block
end