Forums

Access log isn't updating quickly enough

My access log only shows requests made yesterday. It doesn't show the latest requests. Is this a bug or a technical limitation? Regards, Tom

Hi there,

The typical time to expect is < 1 minute. I just experimented and the access logs seem to be showing up with ~5min type delay. I understand that at some time during the day today updates to the access logs may have been delayed by ~an hour. We are investigating the cause of this, and have lessened the load on the log servers etc in the interim. This seems to have gotten us back to <5min delays for now.

Conrad

I seem to have a similar problem, my access logs from one of my apps haven't been updated since the 17th (the other app seems to be okay)

Hi there,

Just did some spot checks and access logs seem to be back to updating in <5 seconds now.

@lint78 your access logs seem to be writing to the error log. Can you think of anything in the code that could do this? Very weird indeed. We shall investigate a bit more- if anything probably clearing the logs and restarting the webapp etc should do the trick.

Hi Conrad,

I don't have any idea of why the web app logging is behaving like that, and now that you told me about the reversing of error/access log I have no problem in keeping it that way. There is only two things that I could think of that could make my app different: 1-Since I am using spyre as the app framework on top of cherrypi, and the only way I could have the spyre site strategy working is to actually launch different apps with the wsgi file (I don't know if this is cheating on the number of apps that I am allowed to deploy on pythonanywhere, if it is I am sorry but that was the only way I could do it), maybe this is messing up things. 2- For my own access data analysis I am actually writing part of the requests information to my own log file. I don't know if this confuses the logging.

Has I told you, since now I already know where my access logs from pythonanywhere go and my own logging seems to work fine, I wouldn't don't bother too much on this issue.

My guess (from your description) is that either Spyre or CherryPy is doing something with the logging that redirects it according to what they expect the hosting environment to be and our hosting environment is slightly different. I don't know how configurable their logging is, so I have no idea if you can change it.

We have no problem with you launching different apps in the wsgi file. As far as we're concerned, they're still just one app and the fact that you implemented them as two apps is just a code layout detail.

I've done a test request, and waited an hour for the response. Then I tried another request and it got logged straight away. It seems that many requests aren't being logged at all

I've also had problems with the server log not logging everything too

The server log is managed through a different system to the access log, so it's really weird if it's not getting stuff too. What kind of thing are you expecting to see in there that isn't there?

Everytime someone makes a request to the server, it should be printing out information about that request to std_out (which I assume gets piped directly to server.log). When I run the code locally it prints something everytime I make a request. However, when I run it on pythonanywhere, it only seems to print out information for very few of the requests. I don't even have other users yet (it's only me who's testing the server).

That sounds really weird. What if you print to stderr instead? That should wind up in the error log.

i see same issue in my access logs. it has not refreshed since 9 days. is there anything that i need to do?

Hi there, we're still working on it I'm afraid. Will keep you posted, everyone.