bosh-director 1.2765.0 → 1.2768.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28b41e6e8624feb1a4f8a3bbe654cc84f45b0d96
4
- data.tar.gz: ed9766fc92fbdc0138263f78c5bac488b575f4da
3
+ metadata.gz: cca5068f726bfe28b704e1c1e5087cc7d2209051
4
+ data.tar.gz: aa7060cd4cfb5833944a0f75c9aa10b56c2ea7e8
5
5
  SHA512:
6
- metadata.gz: 138ceba28cc653b1a64e475b6d5078e2aadcf28422e7272474b5b210ff050b36616a7e8455033569605fd35d5f888168d9227704f5523628d58f888576c72e1e
7
- data.tar.gz: a309f8c84ef1a431ee83af55b5c547dcf020fe6c279b352798eebf80a6ef26d6d49b5c860fd4c0867eb5bb5dfa36693953bb4b6f9859257d5a8656ff7c478ce3
6
+ metadata.gz: 0349f0078e1244e63885899ad5702d24d0414570a8400c6fd8aa91ac3df3a006d6b3277292285777f42c8cfe0aa5040c97daeed91c1705b2f58163760c28b201
7
+ data.tar.gz: 63b2fdcd8d715b04456792df2255710616f100a86b5b183a50605e7ea8484c216307f7c92e0b0af00f2cafe4c6c04dcaeddb998c3ecc250a8161e94f8445d372
@@ -51,10 +51,15 @@ end
51
51
 
52
52
  Bosh::Director::App.new(config)
53
53
 
54
+ logger = Logging::Logger.new('DirectorWorker')
54
55
  resque_logging = config.hash.fetch('resque', {}).fetch('logging', {})
55
- resque_logger_level = resque_logging.fetch('level', 'info').upcase
56
- Resque.logger = MonoLogger.new(resque_logging.fetch('file', STDOUT))
57
- Resque.logger.level = MonoLogger.const_get(resque_logger_level)
56
+ if resque_logging.has_key?('file')
57
+ logger.add_appenders(Logging.appenders.file('DirectorWorkerFile', filename: resque_logging.fetch('file')))
58
+ else
59
+ logger.add_appenders(Logging.appenders.stdout('DirectorWorkerIO'))
60
+ end
61
+ logger.level = Logging.levelify(resque_logging.fetch('level', 'info'))
62
+ Resque.logger = logger
58
63
 
59
64
  worker = nil
60
65
  queues = (ENV['QUEUES'] || ENV['QUEUE']).to_s.split(',')
data/lib/bosh/director.rb CHANGED
@@ -10,8 +10,8 @@ require 'erb'
10
10
  require 'fileutils'
11
11
  require 'forwardable'
12
12
  require 'logger'
13
+ require 'logging'
13
14
  require 'monitor'
14
- require 'mono_logger'
15
15
  require 'optparse'
16
16
  require 'ostruct'
17
17
  require 'pathname'
@@ -1,4 +1,3 @@
1
- # Copyright (c) 2009-2012 VMware, Inc.
2
1
  require 'bosh/director/api/task_remover'
3
2
 
4
3
  module Bosh::Director
@@ -15,7 +14,9 @@ module Bosh::Director
15
14
  log_dir = File.join(Config.base_dir, "tasks", task.id.to_s)
16
15
  task_status_file = File.join(log_dir, "debug")
17
16
  FileUtils.mkdir_p(log_dir)
18
- logger = MonoLogger.new(task_status_file)
17
+
18
+ logger = Logging::Logger.new('DirectorTask')
19
+ logger.add_appenders(Logging.appenders.file('DirectorTaskFile', filename: task_status_file))
19
20
  logger.level = Config.logger.level
20
21
  logger.info("Director Version : #{Bosh::Director::VERSION}")
21
22
  logger.info("Enqueuing task: #{task.id}")
@@ -1,6 +1,5 @@
1
- # Copyright (c) 2009-2012 VMware, Inc.
2
-
3
1
  require 'fileutils'
2
+ require 'logging'
4
3
 
5
4
  module Bosh::Director
6
5
 
@@ -73,16 +72,31 @@ module Bosh::Director
73
72
  # checkpoint task progress every 30 secs
74
73
  @task_checkpoint_interval = 30
75
74
 
76
- logging = config.fetch('logging', {})
77
- @log_device = MonoLogger::LocklessLogDevice.new(logging.fetch('file', STDOUT))
78
- @logger = MonoLogger.new(@log_device)
79
- @logger.level = Logger.const_get(logging.fetch('level', 'debug').upcase)
80
- @logger.formatter = ThreadFormatter.new
75
+ logging_config = config.fetch('logging', {})
76
+ if logging_config.has_key?('file')
77
+ @log_file_path = logging_config.fetch('file')
78
+ shared_appender = Logging.appenders.file(
79
+ 'DirectorLogFile',
80
+ filename: @log_file_path,
81
+ layout: ThreadFormatter.layout
82
+ )
83
+ else
84
+ shared_appender = Logging.appenders.io(
85
+ 'DirectorStdOut',
86
+ STDOUT,
87
+ layout: ThreadFormatter.layout
88
+ )
89
+ end
90
+
91
+ @logger = Logging::Logger.new('Director')
92
+ @logger.add_appenders(shared_appender)
93
+ @logger.level = Logging.levelify(logging_config.fetch('level', 'debug'))
81
94
 
82
- # use a separate logger for redis to make it stfu
83
- redis_logger = MonoLogger.new(@log_device)
84
- logging = config.fetch('redis', {}).fetch('logging', {})
85
- @redis_logger_level = Logger.const_get(logging.fetch('level', 'info').upcase)
95
+ # use a separate logger with the same appender to avoid multiple file writers
96
+ redis_logger = Logging::Logger.new('DirectorRedis')
97
+ redis_logger.add_appenders(shared_appender)
98
+ logging_config = config.fetch('redis', {}).fetch('logging', {})
99
+ @redis_logger_level = Logging.levelify(logging_config.fetch('level', 'info'))
86
100
  redis_logger.level = @redis_logger_level
87
101
 
88
102
  # Event logger supposed to be overridden per task,
@@ -137,7 +151,7 @@ module Bosh::Director
137
151
  end
138
152
 
139
153
  def log_dir
140
- File.dirname(@log_device.filename) if @log_device.filename
154
+ File.dirname(@log_file_path) if @log_file_path
141
155
  end
142
156
 
143
157
  def use_compiled_package_cache?
@@ -346,7 +346,7 @@ module Bosh::Director
346
346
  end
347
347
 
348
348
  @event_log.begin_stage('Deleting unneeded VMs', unneeded_vms.size)
349
- ThreadPool.new(:max_threads => Config.max_threads).wrap do |pool|
349
+ ThreadPool.new(max_threads: Config.max_threads, logger: @logger).wrap do |pool|
350
350
  unneeded_vms.each do |vm_model|
351
351
  pool.process do
352
352
  @event_log.track(vm_model.cid) do
@@ -24,7 +24,21 @@ module Bosh::Director
24
24
 
25
25
  class Log
26
26
  def initialize(io = nil)
27
- @logger = CustomLogger.new(io || StringIO.new)
27
+ @logger = Logging::Logger.new('EventLog')
28
+ if io.is_a?(String)
29
+ @logger.add_appenders(Logging.appenders.file(
30
+ 'EventFile',
31
+ filename: io,
32
+ layout: Logging.layouts.pattern(:pattern => '%m\n')
33
+ ))
34
+ else
35
+ @logger.add_appenders(Logging.appenders.io(
36
+ 'EventIO',
37
+ io || StringIO.new,
38
+ layout: Logging.layouts.pattern(:pattern => '%m\n')
39
+ ))
40
+ end
41
+
28
42
  @last_stage = Stage.new(self, 'unknown', [], 0)
29
43
  end
30
44
 
@@ -143,11 +157,5 @@ module Bosh::Director
143
157
  @stage.log_entry(task_entry)
144
158
  end
145
159
  end
146
-
147
- class CustomLogger < ::Logger
148
- def format_message(level, time, progname, msg)
149
- msg + "\n"
150
- end
151
- end
152
160
  end
153
161
  end
@@ -53,19 +53,23 @@ module Bosh::Director
53
53
  event_log = File.join(log_dir, 'event')
54
54
  result_log = File.join(log_dir, 'result')
55
55
 
56
- debug_log_device = MonoLogger::LocklessLogDevice.new(debug_log)
57
-
58
- @task_logger = MonoLogger.new(debug_log_device)
56
+ @task_logger = Logging::Logger.new('DirectorJobRunner')
57
+ shared_appender = Logging.appenders.file(
58
+ 'DirectorJobRunnerFile',
59
+ filename: debug_log,
60
+ layout: ThreadFormatter.layout
61
+ )
62
+ @task_logger.add_appenders(shared_appender)
59
63
  @task_logger.level = Config.logger.level
60
- @task_logger.formatter = ThreadFormatter.new
61
64
 
62
65
  Config.event_log = EventLog::Log.new(event_log)
63
66
  Config.result = TaskResultFile.new(result_log)
64
67
  Config.logger = @task_logger
65
68
 
66
- redis_task_logger = MonoLogger.new(debug_log_device)
69
+ # use a separate logger with the same appender to avoid multiple file writers
70
+ redis_task_logger = Logging::Logger.new('DirectorJobRunnerRedis')
71
+ redis_task_logger.add_appenders(shared_appender)
67
72
  redis_task_logger.level = Config.redis_logger_level
68
- redis_task_logger.formatter = ThreadFormatter.new
69
73
  Config.redis_logger = redis_task_logger
70
74
 
71
75
  Config.db.logger = @task_logger
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Director
3
- VERSION = '1.2765.0'
3
+ VERSION = '1.2768.0'
4
4
  end
5
5
  end
data/lib/cloud/dummy.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'digest/sha1'
2
2
  require 'fileutils'
3
3
  require 'securerandom'
4
- require 'mono_logger'
5
4
 
6
5
  module Bosh
7
6
  module Clouds
@@ -20,7 +19,11 @@ module Bosh
20
19
 
21
20
  @running_vms_dir = File.join(@base_dir, 'running_vms')
22
21
 
23
- @logger = MonoLogger.new(options['log_device'] || STDOUT)
22
+ @logger = Logging::Logger.new('DummyCPI')
23
+ @logger.add_appenders(Logging.appenders.io(
24
+ 'DummyCPIIO',
25
+ options['log_buffer'] || STDOUT
26
+ ))
24
27
 
25
28
  @commands = CommandTransport.new(@base_dir, @logger)
26
29
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh-director
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2765.0
4
+ version: 1.2768.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2014-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt-ruby
@@ -30,140 +30,140 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2765.0
33
+ version: 1.2768.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.2765.0
40
+ version: 1.2768.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bosh-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.2765.0
47
+ version: 1.2768.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.2765.0
54
+ version: 1.2768.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bosh-director-core
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.2765.0
61
+ version: 1.2768.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.2765.0
68
+ version: 1.2768.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bosh_common
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 1.2765.0
75
+ version: 1.2768.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 1.2765.0
82
+ version: 1.2768.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bosh-template
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.2765.0
89
+ version: 1.2768.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.2765.0
96
+ version: 1.2768.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: bosh_cpi
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.2765.0
103
+ version: 1.2768.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.2765.0
110
+ version: 1.2768.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: bosh_openstack_cpi
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.2765.0
117
+ version: 1.2768.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.2765.0
124
+ version: 1.2768.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: bosh_aws_cpi
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 1.2765.0
131
+ version: 1.2768.0
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 1.2765.0
138
+ version: 1.2768.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: bosh_vsphere_cpi
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.2765.0
145
+ version: 1.2768.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 1.2765.0
152
+ version: 1.2768.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: bosh_warden_cpi
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.2765.0
159
+ version: 1.2768.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.2765.0
166
+ version: 1.2768.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: bosh_vcloud_cpi
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -221,19 +221,19 @@ dependencies:
221
221
  - !ruby/object:Gem::Version
222
222
  version: 2.4.0
223
223
  - !ruby/object:Gem::Dependency
224
- name: mono_logger
224
+ name: logging
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: 1.1.0
229
+ version: 1.5.0
230
230
  type: :runtime
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: 1.1.0
236
+ version: 1.5.0
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: nats
239
239
  requirement: !ruby/object:Gem::Requirement
@@ -460,7 +460,7 @@ dependencies:
460
460
  version: '0'
461
461
  description: |-
462
462
  BOSH Director
463
- ae0a5a
463
+ 2b24dc
464
464
  email: support@cloudfoundry.com
465
465
  executables:
466
466
  - bosh-director