Question

While using the appcfg.py request_logs, it shows "copy the download logs to [the output file path]". Where would be the location google app engine used to store the temp file?

EDIT1

While using appcfg.py request_logs, I noticed that the first program will first download logs to a temp place then it copy these files to the user specify output file . I am looking for where the data stored before it has been copy to the target log file.

Was it helpful?

Solution 2

I found out GAE firstly using standard tempfile to store logs at first. Then it copy them to the desired output file location.

def DownloadLogs(self):
    """Download the requested logs.

    This will write the logs to the file designated by
    self.output_file, or to stdout if the filename is '-'.
    Multiple roundtrips to the server may be made.
    """
    StatusUpdate('Downloading request logs for %s %s.' %
                 (self.config.application, self.version_id))





    tf = tempfile.TemporaryFile()
    last_offset = None
    try:
      while True:
        try:
          new_offset = self.RequestLogLines(tf, last_offset)
          if not new_offset or new_offset == last_offset:
            break
          last_offset = new_offset
        except KeyboardInterrupt:
          StatusUpdate('Keyboard interrupt; saving data downloaded so far.')
          break
      StatusUpdate('Copying request logs to %r.' % self.output_file)
      if self.output_file == '-':
        of = sys.stdout
      else:
        try:
          of = open(self.output_file, self.write_mode)
        except IOError, err:
          StatusUpdate('Can\'t write %r: %s.' % (self.output_file, err))
          sys.exit(1)
      try:
        line_count = CopyReversedLines(tf, of)
      finally:
        of.flush()
        if of is not sys.stdout:
          of.close()
    finally:
      tf.close()
    StatusUpdate('Copied %d records.' % line_count)

OTHER TIPS

I'm not sure I've understood your question, but if you run a command like this from your app engine project directory (where your app.yaml file is):

appcfg.py request_logs . logs.out

then the output will end up in the file logs.out in that same directory (your project directory).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top