15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/bosh/director/logs_fetcher.rb', line 15
def fetch(instance, log_type, filters)
@logger.info("Fetching logs from agent with log_type=#{log_type} filters=#{filters}")
@log_bundles_cleaner.clean
agent = @instance_manager.agent_client_for(instance)
blobstore_id = nil
stage = Config.event_log.begin_stage("Fetching logs for #{instance.job}/#{instance.uuid} (#{instance.index})", 1)
stage.advance_and_track('Finding and packing log files') do
fetch_logs_result = agent.fetch_logs(log_type, filters)
blobstore_id = fetch_logs_result['blobstore_id']
end
if blobstore_id.nil?
raise AgentTaskNoBlobstoreId,
"Agent didn't return a blobstore object id for packaged logs"
end
@log_bundles_cleaner.register_blobstore_id(blobstore_id)
blobstore_id
end
|