summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-11-26 09:59:45 -0800
committerSerdar Sutay <serdar@opscode.com>2014-11-26 09:59:45 -0800
commit95f72757e74c09f259ea55bade023757085222db (patch)
tree42a20c67ceeaf855d512b35bdf1fbe0b37ea09f5
parentbfffa7c10d8afa2ecc5c6500bac61b31b8faa7ea (diff)
parent7893031d65f7591fd6f3418ec0b1658c5113409b (diff)
downloadchef-zero-95f72757e74c09f259ea55bade023757085222db.tar.gz
Merge pull request #103 from jaymzh/logfile
Add option for logging to a file.
-rwxr-xr-xbin/chef-zero9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/chef-zero b/bin/chef-zero
index 2d42468..54739bc 100755
--- a/bin/chef-zero
+++ b/bin/chef-zero
@@ -6,6 +6,7 @@ Signal.trap('INT') { exit 1 }
require 'rubygems'
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..", "lib")))
+require 'chef_zero/log'
require 'chef_zero/version'
require 'chef_zero/server'
require 'chef_zero/data_store/raw_file_store'
@@ -50,6 +51,10 @@ OptionParser.new do |opts|
options[:log_level] = value
end
+ opts.on("--log-file FILE", "Log to a file") do |value|
+ options[:log_file] = value
+ end
+
opts.on("--multi-org", "Whether to run in multi-org mode") do |value|
options[:single_org] = nil
end
@@ -77,6 +82,10 @@ if options[:data_store]
options[:data_store] = ChefZero::DataStore::DefaultFacade.new(options[:data_store], options[:single_org], false)
end
+if options[:log_file]
+ ChefZero::Log.init(options[:log_file])
+end
+
server = ChefZero::Server.new(options)
if options[:daemon]