Skip to content Skip to sidebar Skip to footer

How To Decode The Persisted Log Files From App Engine's Python Dev_server

Using Google App Engine's local dev_server, one of the published options is to save the log files to disk. 'If you wish to persist the logs from the development server to disk a

Solution 1:

The logfile created is a SQLite database. Use the sqlite3 module to access it.

The schema used is:

CREATETABLE AppLogs (
  id INTEGERNOTNULLPRIMARY KEY,
  request_id INTEGERNOTNULL,
  timestampINTEGERNOTNULL,
  level INTEGERNOTNULL,
  message TEXT NOTNULL,
  FOREIGN KEY(request_id) REFERENCES RequestLogs(id)
);
CREATETABLE RequestLogs (
  id INTEGERNOTNULLPRIMARY KEY,
  user_request_id TEXT NOTNULL,
  app_id TEXT NOTNULL,
  version_id TEXT NOTNULL,
  module TEXT NOTNULL,
  ip TEXT NOTNULL,
  nickname TEXT NOTNULL,
  start_time INTEGERNOTNULL,
  end_time INTEGERDEFAULT0NOTNULL,
  method TEXT NOTNULL,
  resource TEXT NOTNULL,
  http_version TEXT NOTNULL,
  status INTEGERDEFAULT0NOTNULL,
  response_size INTEGERDEFAULT0NOTNULL,
  user_agent TEXT NOTNULL,
  url_map_entry TEXT DEFAULT''NOTNULL,
  host TEXT NOTNULL,
  task_queue_name TEXT DEFAULT''NOTNULL,
  task_name TEXT DEFAULT''NOTNULL,
  latency INTEGERDEFAULT0NOTNULL,
  mcycles INTEGERDEFAULT0NOTNULL,
  finished INTEGERDEFAULT0NOTNULL
);

RequestLogs contains HTTP requests (from a browser or a task queue); AppLogs contains any logging entries recorded during a specific request.

Post a Comment for "How To Decode The Persisted Log Files From App Engine's Python Dev_server"