summaryrefslogtreecommitdiff
path: root/lib/oxidized.rb
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-07-22 13:20:14 +0200
committerGitHub <noreply@github.com>2016-07-22 13:20:14 +0200
commit2e4f50bc401ddb42b1ff850b04812ca611fa8fcb (patch)
tree110081a22d60a7dbf473200614702e7a6d9b3f7f /lib/oxidized.rb
parentdd6f5df411a3ba0e9158d6c1fc5293aa53c47a29 (diff)
parent4508cfa6288ecfaf673ba45f10739798dbfe7b34 (diff)
Merge pull request #505 from danilopopeye/ds-create-logs-directory
create a `logs` dir for all the debug logs
Diffstat (limited to 'lib/oxidized.rb')
-rw-r--r--lib/oxidized.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/oxidized.rb b/lib/oxidized.rb
index dfd9679..f40daf9 100644
--- a/lib/oxidized.rb
+++ b/lib/oxidized.rb
@@ -1,3 +1,5 @@
+require 'fileutils'
+
module Oxidized
class OxidizedError < StandardError; end
@@ -34,6 +36,7 @@ module Oxidized
end
def self.setup_logger
+ FileUtils.mkdir_p(Config::Log) unless File.directory?(Config::Log)
self.logger = if config.has_key?('use_syslog') && config.use_syslog
require 'syslog/logger'
Syslog::Logger.new('oxidized')