3

I want to download the raw access logs from google app engine app written in python.

I have tried following commands:

appcfg.py request_logs --num_days=2 . ~/Documents/workspace/loganalyzer/applog_29march.log

Gives me 47943 records.
But the records does have only header in http clf format. {Here i need to get the detailed log for each record, but i get only headers}

But if i use

appcfg.py --severity=0 --num_days=2 request_logs . ~/Documents/workspace/loganalyzer/applog_27March.log
appcfg.py --severity=1 --num_days=2 --append request_logs . ~/Documents/workspace/loganalyzer/applog_27March.log
appcfg.py --severity=2 --num_days=2 --append request_logs . ~/Documents/workspace/loganalyzer/applog_27March.log
appcfg.py --severity=3 --num_days=2 --append request_logs . ~/Documents/workspace/loganalyzer/applog_27March.log
appcfg.py --severity=4 --num_days=2 --append request_logs . ~/Documents/workspace/loganalyzer/applog_27March.log

I get a total of only 2000 records with detailed errors also.

In my opinion they should match to 47943 records.

systempuntoout
  • 71,966
  • 47
  • 171
  • 241
androidexp
  • 61
  • 1
  • 3
  • Pass --severity when downloading logs. Answered in SO here: http://stackoverflow.com/questions/2229293/download-log-from-appengine-including-python-log-statements – srinivas1729 May 13 '15 at 10:23

1 Answers1

4

App Engine uses circular buffers for the different levels of logs - one for each severity level. When it runs out of space, it overwrites the oldest log entries. As a result, your error logs will go back further than your warning logs, which will go further than info logs, and so forth - and ordinary HTTP request logs will be kept the longest.

Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
  • But then how am i able to view them in the google app engine log viewer? – androidexp Mar 29 '11 at 05:58
  • @androidexp Are you? How did you determine how many error/debug/etc log entries there are in the viewer? – Nick Johnson Mar 29 '11 at 06:24
  • I think question is asking for "detailed logs". The appcfg tool can only be used to download basic request details e.g client-ip, url/query/path, http-status. In the viewer you can see all log msgs emitted by the app in addition – srinivas1729 May 13 '15 at 10:18
  • @srinivas1729 No, the command line above allows you to download log messages from the app, not just HTTP logs. – Nick Johnson May 13 '15 at 14:56