Quantcast
Channel: Interwebbythings
Viewing all articles
Browse latest Browse all 4

Analyzing Google App Engine logs with AWStats

$
0
0

Most of the time, you can easily find the most CPU-intensive pages on your Google App Engine website by looking at the Current Load info on your application dashboard, but no specific bandwidth information is shown there. You can get this information by downloading your application logs and analyzing them with AWStats.

Although I’m using Mac OS most steps will be very similar if you use another operating system.

If you are running Windows you might need to install Perl first.

1. Download the logs

Open a terminal window and use appcfg.py to download the application logs:

appcfg.py request_logs {{directory of your app.yaml file}} applogs.txt –num_days=0

This will download all the logs that are available, the GAE documentation explains how you can limit your request to a specific date range.

2. Set up AWStats

The logs provided by App Engine are formatted as Apache log files and you can use AWStats to analyze them. I found AWStats to be quite difficult to use, so here’s how to set it up step by step:

a) Download and unpack AWStats
b) You need a configuration file to create a report; run awstats_configure.pl in the tools folder like this: “perl awstats_configure“.
You need to answer its questions like this: Yes, you want to use  a non-standard directory; you don’t have a web server with a config file (=> none); yes, you do want to create a new config file. Then enter a name for your website, it will be used for the name of the config file.
c) You now have a config file in the wwwroot/cgi-bin folder. Open the file in a text editor.
d) Look for the LogFile value and make it point to your downloaded log file.
e) Look for the DirData value and make it point to an existing directory where AWStats can store files
f) Now you can make AWStats update its analysis by running “perl awstats.pl -config={{the name you gave your website in step b}} -update

3. Create reports

Take a look at the documentation to create individual reports; you can use the awstats_buildstaticpages.pl tool to generate a lot of reports by copying it to the cgi-bin folder and running it:

perl awstats_buildstaticpages.pl -config={{the name you gave your website}} -awstatsprog=./awstats.pl

You can use the year and month parameters of AWStats to choose the month for the detailed report.

If your logs change, make sure that you update AWStats analysis before creating reports.



Viewing all articles
Browse latest Browse all 4

Trending Articles