code: def new_logger(name):
      '''Return new logger which will log both to logstash and to file in JSON
      format.
  
      Log files are stored in <logdir>/name.json
      '''
  
      log = get_task_logger(name)
  
      handler = logstash.LogstashHandler(
          config.logstash.host, config.logstash.port)
      log.addHandler(handler)
  
      create_logdir(config.logdir)
      handler = TimedRotatingFileHandler(
          '%s.json' % join(config.logdir, name),
          when='midnight',
          utc=True,
      )
      handler.setFormatter(JSONFormatter())
      log.addHandler(handler)
  
      return TaskCtxAdapter(log, {}f new_logger(name):
      '''Return new logger which will log both to logstash and to file in JSON
      format.
  
      Log files are stored in <logdir>/name.json
      '''
  
      log = get_task_logger(name)
  
      handler = logstash.LogstashHandler(
          config.logstash.host, config.logstash.port)
      log.addHandler(handler)
  
      create_logdir(config.logdir)
      handler = TimedRotatingFileHandler(
          '%s.json' % join(config.logdir, name),
          when='midnight',
          utc=True,
      )
      handler.setFormatter(JSONFormatter())
      log.addHandler(handler)
  
      return TaskCtxAdapter(log, {})
docs: Return new logger which will log both to logstash and to file in JSON
      format.
  
      Log files are stored in <logdir>/name.json