0

The question is pretty much the same as this one: How to log a request to apache access log if it's cached by Varnish

but instead of varnish let's say I am using CloudFlare.

Is there any way to get the access logs to my server? Or I depend fully on the tools offered by the CDN?

I mean access to cached content like pdf files or static html that is served directly from Cloudflare/cache system external to my server.

Cesc
  • 191
  • 9
  • ok sorry I should have seen this before: https://support.cloudflare.com/hc/en-us/articles/200171276-How-do-I-export-my-CloudFlare-statistics- – Cesc Dec 16 '15 at 07:40

1 Answers1

0

So it depends on the tools available. For example CF doesn't give ou any access to logs, it just shows some page visits counter, but not the details by ip user etc.

The best way might be Google Analytics like solution. Add some javascript in your backend that fires requests to teh server with the proper information. There are though several complications with this approach:

-It's hard to get the IP from user via javascript, even the Ip of the server where the javascript is being executed. It can be easily modified by other users.

-If you are using cache it means that you worr about performance, sending a request at each page view is adding lots of overload to your server. So you might use a different server to treat those.

If anybody else knows of a very smart system for that please let me know.

Cesc
  • 191
  • 9