loggers
This commit is contained in:
parent
32443651f6
commit
afbe4f691f
@ -1,5 +1,6 @@
|
|||||||
require 'sinatra/base'
|
require 'sinatra/base'
|
||||||
require 'core/devops-logger'
|
require 'core/devops-logger'
|
||||||
|
require 'core/devops-config'
|
||||||
|
|
||||||
class Client < Sinatra::Base
|
class Client < Sinatra::Base
|
||||||
|
|
||||||
@ -9,7 +10,9 @@ class Client < Sinatra::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
configure :production do
|
configure :production do
|
||||||
logger = DevopsLogger.create("/tmp/devops-client.log", Logger::INFO)
|
config = DevopsConfig.config
|
||||||
|
log_file = File.join(config[:log_dir], "devops-client.log")
|
||||||
|
logger = DevopsLogger.create(log_file, Logger::INFO)
|
||||||
use Rack::CommonLogger, logger
|
use Rack::CommonLogger, logger
|
||||||
disable :dump_errors
|
disable :dump_errors
|
||||||
disable :show_exceptions
|
disable :show_exceptions
|
||||||
@ -18,7 +21,9 @@ class Client < Sinatra::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
configure :development do
|
configure :development do
|
||||||
logger = DevopsLogger.create("/tmp/devops-client.log", Logger::DEBUG)
|
config = DevopsConfig.config
|
||||||
|
log_file = File.join(config[:log_dir], "devops-client.log")
|
||||||
|
logger = DevopsLogger.create(log_file, Logger::DEBUG)
|
||||||
use Rack::CommonLogger, logger
|
use Rack::CommonLogger, logger
|
||||||
# set :logging, Logger::DEBUG
|
# set :logging, Logger::DEBUG
|
||||||
disable :raise_errors
|
disable :raise_errors
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
require 'core/devops-logger'
|
||||||
|
require 'core/devops-config'
|
||||||
|
|
||||||
module Devops
|
module Devops
|
||||||
|
|
||||||
class SidekiqApplication < Application
|
class SidekiqApplication < Application
|
||||||
@ -7,6 +10,10 @@ module Devops
|
|||||||
end
|
end
|
||||||
|
|
||||||
def routes
|
def routes
|
||||||
|
config = DevopsConfig.config
|
||||||
|
log_file = File.join(config[:log_dir], "devops-sidekiq-web.log")
|
||||||
|
logger = DevopsLogger.create(log_file, Logger::INFO)
|
||||||
|
Sidekiq::Web.use Rack::CommonLogger, logger
|
||||||
Devops::Routes.route "/sidekiq", Sidekiq::Web
|
Devops::Routes.route "/sidekiq", Sidekiq::Web
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
# path to log file
|
# path to log dir
|
||||||
config[:log_file] = "/path/to/log"
|
config[:log_dir] = "/path/to/log"
|
||||||
# path to chef knife.rb file
|
# path to chef knife.rb file
|
||||||
config[:knife_config_file] = "/path/to/.chef/knife.rb"
|
config[:knife_config_file] = "/path/to/.chef/knife.rb"
|
||||||
# role name separator
|
# role name separator
|
||||||
@ -40,4 +40,4 @@ config[:static_ssh_key] = "ssh_key" # or nil
|
|||||||
config[:static_certificate] = "/path/to/.ssh/static.pem"
|
config[:static_certificate] = "/path/to/.ssh/static.pem"
|
||||||
|
|
||||||
config[:debug] = true
|
config[:debug] = true
|
||||||
config[:stub_classes] = true
|
config[:stub_classes] = true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user