def _Dynamic_Flush(self, request, unused_response, request_id=None):
    group = log_service_pb.UserAppLogGroup(request.logs())
    logs = group.log_line_list()

    appid = os.environ['APPLICATION_ID']
    if appid in ['apichecker', 'appscaledashboard']:
      return

    # The AppDashboard displays logs in the Java style, which starts at 1. Since
    # Python's log levels start at 0 (for DEBUG), bump these by one to keep them
    # in sync.
    formatted_logs = [{'timestamp' : log.timestamp_usec() / 1e6,
      'level' : log.level() + 1,
      'message' : log.message()} for log in logs]

    if not formatted_logs:
      return

    payload = json.dumps({
      'service_name' : appid,
      'host' : os.environ['MY_IP_ADDRESS'],
      'logs' : formatted_logs
    })

    nginx_host = os.environ['NGINX_HOST']

    logservice.SendLogsThread(payload, nginx_host).start()

    # AppScale: The following appear to cause a memory leak under high load.
    # Investigate this once we wish to support the Logs API.
    #if self.persist:
    #  group = log_service_pb.UserAppLogGroup(request.logs())
    #  new_app_logs = self.put_log_lines(group.log_line_list())
    #  self.write_app_logs(new_app_logs)
Writes application-level log messages for a request to the Datastore.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/logservice/logservice_stub.py/LogServiceStub._Dynamic_Flush