Cannot find app logs using AppEngine's dev_appserver

118 views
Skip to first unread message

P.Y. Laligand

unread,
Mar 18, 2016, 12:44:35 PM3/18/16
to Dart Server-side and Cloud Development
(creating a separate topic for this question I had in my previous post)

So now that I have the appserver running correctly I'm trying to see what my server is doing by adding logs. Problem is, I can't find them anywhere. Here's what I see in my terminal:

----------------------------------------------------------------------
$ dev_appserver.py --custom_entrypoint "dart bin/server.dart {port}" --log_level=debug app.yaml
INFO     2016-03-18 16:22:18,994 application_configuration.py:431] No version specified. Generated version id: 20160318t162218
INFO     2016-03-18 16:22:18,995 devappserver2.py:769] Skipping SDK update check.
INFO     2016-03-18 16:22:19,034 api_server.py:205] Starting API server at: http://localhost:55738
INFO     2016-03-18 16:22:19,039 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO     2016-03-18 16:22:19,042 admin_server.py:116] Starting admin server at: http://localhost:8000
INFO     2016-03-18 16:22:20,054 module.py:1729] New instance for module "default" serving on:

INFO     2016-03-18 16:22:20,094 module.py:787] default: "GET /_ah/start HTTP/1.1" 200 2
INFO     2016-03-18 16:22:26,009 module.py:787] default: "POST /trials HTTP/1.1" 200 31
INFO     2016-03-18 16:26:39,299 module.py:1768] [default] Detected file changes:
  /Users/pylaligand/Work/destiny/destiny-tools/slack-bot/bin/server.dart
INFO     2016-03-18 16:26:39,310 module.py:1893] Waiting for instances to restart
INFO     2016-03-18 16:26:40,320 module.py:1729] New instance for module "default" serving on:

INFO     2016-03-18 16:26:40,363 module.py:787] default: "GET /_ah/start HTTP/1.1" 200 2
INFO     2016-03-18 16:26:40,374 module.py:1899] Instances restarted
INFO     2016-03-18 16:26:40,407 module.py:1768] [default] Detected file changes:
  /Users/pylaligand/Work/destiny/destiny-tools/slack-bot/bin/server.dart
INFO     2016-03-18 16:26:40,417 module.py:1893] Waiting for instances to restart
INFO     2016-03-18 16:26:41,430 module.py:1729] New instance for module "default" serving on:

INFO     2016-03-18 16:26:41,469 module.py:787] default: "GET /_ah/start HTTP/1.1" 200 2
INFO     2016-03-18 16:26:41,473 module.py:1899] Instances restarted
INFO     2016-03-18 16:26:43,838 module.py:787] default: "POST /trials HTTP/1.1" 200 31
----------------------------------------------------------------------

All of these seem to be dev_appserver's logs, none are my app's.

I tried to use the --logs_path flag to redirect the logs database to a file, but only the RequestLogs table seems to be populated as the AppLogs table remains empty.

Looking at past post it used to be that |gcloud preview app run|'s verbosity needed to be set to debug for logs to show up. Is there an equivalent trick with dev_appserver?

P.Y. Laligand

unread,
Mar 18, 2016, 12:53:11 PM3/18/16
to Dart Server-side and Cloud Development
Instant update: if I wrap runAppEngine in a withAppEngineServices call, then using the logging service does add entries to the AppLogs table. I still can't see anything in my terminal, nor do a Logger (with the adaptor for AE) or a |print| call create any entry.

Daniel Domberger

unread,
Mar 21, 2016, 8:25:21 AM3/21/16
to Dart Server-side and Cloud Development
Heya,

we've run into this problem as well. Our solution was to only ever log into logfiles (and `tail -f` them as needed). There also is or was a bug in the communication between dev_appserver and the dart appengine lib where messages in the stdout buffer wouldn't be consumed. This lead to dev_appserver hang after a certain amount of messages sent to stdout. Søren Gjesse was kind enough to find the issue (we only saw dev_appserver randomly locking up). Here again the workaround was to never ever write to stdout but only to logfiles. Don't know if this is still relevant though.

Best regards
daniel

Tony Downey

unread,
Jun 9, 2016, 5:47:41 PM6/9/16
to Dart Server-side and Cloud Development
Having a problem with this as well. Trying to log messages to the terminal when I run a server, but the following commands all have no effect:
print(msg);
context.services.logging.info(msg);
loggingService.info(msg);

Tried the same while running the flags:
--dev_appserver_log_level debug
--log_level debug

No change.
Quickest way to reproduce this bug - run the Cloud Datastore sample at https://github.com/dart-lang/appengine_samples

So yeah, the workaround for the moment is to create your own records of logs. Not super ideal.
Reply all
Reply to author
Forward
0 new messages