Forums

Best way to keep access logs?

Hi there,

What's the recommended way to grab the access logs so I can analyze and then archive them? I know they're rotated when they get big enough and I don't want to risk losing the data.

thanks,

Lauren

Do you want to grab them and save them outside of PythonAnywhere? Or just within/in a different location so they are not rotated.

You could write a scheduled task that copied them somewhere safe in your home directory every hour or so, perhaps? When we rotate the logs, the old ones are kept for a while -- that is, XXXXX.access.log becomes XXXXX.access.log.1, XXXXX.access.log.1 becomes XXXXX.access.log.2.gz, and so on up to XXXXX.access.log.9.

Eventually I will want to be able to process 3 months at once, which I can do on my local machine once I've downloaded them. I'll try out the scheduled task idea to copy to my home directory and then rsync via ssh to my local machine.

Thanks!

Lauren