Backend confusion

54 views
Skip to first unread message

WanderingGAE

unread,
Jul 26, 2011, 9:26:26 AM7/26/11
to google-a...@googlegroups.com
I'm having a tough time figuring out how to use the Backends properly.

I have it registering and running, but I'm not quite sure how I should be using it... here is the backend code:

class StartHandler(webapp.RequestHandler):
    def get(self):
        logging.debug("Starting up!")
        logservice.flush()

def main():
    application = webapp.WSGIApplication([('/_ah/start', StartHandler)],
                                         debug=True)
    util.run_wsgi_app(application)

I've tried several variations  with logservice, but I never get a log message that the backend has started up.  I really just want to do some datastore work when the backend starts up.  Any help would be appreciated.  


WanderingGAE

unread,
Jul 26, 2011, 9:46:41 AM7/26/11
to google-a...@googlegroups.com
I've also tried this in the file, no log messages seen.

from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.api import logservice
import logging
import time

logservice.AUTOFLUSH_ENABLED = False

logging.debug("Starting up!")
logservice.flush()

while True:
    logging.debug("Check!")
    logservice.flush()
    time.sleep(5)

WanderingGAE

unread,
Jul 26, 2011, 9:50:48 AM7/26/11
to google-a...@googlegroups.com
And my backends.yaml....

backends:
- name: counter
  start: counter.py
  instances: 1
  class: B1

Justin Haugh

unread,
Jul 28, 2011, 3:44:47 PM7/28/11
to google-a...@googlegroups.com
What's your application ID?  Your should certainly see something in the logs.  Also, you might want to double-check that you're using appcfg backends update (verify with appcfg backends list) and looking at the logs specifically for your backend (using the Version/Backend dropdown).

Justin

Volker Schönefeld

unread,
Sep 3, 2011, 9:57:34 AM9/3/11
to Google App Engine
I've had the same issues with the backend logservice. As soon as I use
logservice anywhere in the code, no log messages will appear at all,
except for service error 201 and instance startups. I've also posted a
related post here:

http://groups.google.com/group/google-appengine/browse_thread/thread/637e89696e1561ca#

app id is "towermadness", backend is "deleter". I've done all the
things you mentioned (i'm using backends update all the time, and i'm
looking at the backend log).
Reply all
Reply to author
Forward
0 new messages