module ActiveJob::Logging

def logger_tagged_by_active_job?

def logger_tagged_by_active_job?
  logger.formatter.current_tags.include?("ActiveJob")
end

def perform_now

def perform_now
  tag_logger(self.class.name, self.job_id) { super }
end

def tag_logger(*tags, &block)

def tag_logger(*tags, &block)
  if logger.respond_to?(:tagged)
    tags.unshift "ActiveJob" unless logger_tagged_by_active_job?
    logger.tagged(*tags, &block)
  else
    yield
  end
end