Upgrade to Pro — share decks privately, control downloads, hide ads and more …

サービス基盤におけるRuby~JSOX編~ / speee_pepabo_ruby

Ryo Takaishi
January 18, 2017

サービス基盤におけるRuby~JSOX編~ / speee_pepabo_ruby

Ryo Takaishi

January 18, 2017
Tweet

More Decks by Ryo Takaishi

Other Decks in Technology

Transcript

  1. ͳͥ΍ͬͨͷ͔ w +409ͷ؂ࠪͰඞཁʹͳͬͨ w +409  w ࣾ಺ΛͪΌΜͱίϯτϩʔϧ͠·͠ΐ͏ɺͱ͍͏͜ͱ ࡶ 

    w ͨͱ͑͹ʜ w ݖݶΛ࣋ͭϢʔβͷΈγεςϜʹΞΫηεͰ͖Δ͔ʁ w γεςϜมߋͷཤྺ͕؅ཧ͞Ε͍ͯΔ͔ʁ
  2. "DUJWF4VQQPSU-PHHFSCSPBEDBTU w ϩάΛෳ਺ͷ-PHHFSʹૹΔͨΊͷϝιου w ྫʣඪ४ग़ྗ ϑΝΠϧ w ྫʣϑΝΠϧ ϑΝΠϧ new_logger

    = ActiveSupport::Logger.new(logdev) multiple_loggers = ActiveSupport::Logger.broadcast(new_logger) @logger.extend(multiple_loggers)
  3. .VMUJ*0 w ෳ਺ͷ*0ʹର͠ॲཧΛߦ͏ͨΊͷΫϥε w TUEPVUDMBTT*0 w ྫʣ45%065 ϑΝΠϧ class MultiIO

    # @param [Array<IO>] io_list def initialize(io_list) @io_list = io_list end [snip] def write(str) @io_list.each do |io| io.write(str) io.flush end end [snip] end
  4. ϩάΛ4MBDLʹఴ෇͢Δ w "1*Λ࢖ͬͯ4MBDLʹϑΝΠϧΛఴ෇Ͱ͖Δ pMFTVQMPBE  w XSBQQFSMJCSBSZΛ࢖༻ MJOZPXTCSFBDBO def send_log_slack(task,

    tmplog) Breacan.access_token = '#{SLACK_ACCESS_TOKEN}' arg = { channels: ENV['RAKE_NOTIFY_TO'] || '#minne_dev', file: Faraday::UploadIO.new(tmplog.path, 'text/plain'), filename: "#{File.basename(task.name)}_#{Time.now.strftime('%Y%m%d%H%M%S')}.log" } Breacan.files_upload(arg) end