AppEngine tutorial
http://code.google.com/appengine/docs/java/gettingstarted/usingjsps.html
suggests that the debug logs generated by java.util.logging.Logger can be seen at admin console.
However I don't see the log information from admin console for local instance at http://localhost:8888/_ah/admin
Is there a way to see debug log when developing locally?
Thanks
I see them appearing in the terminal where I start the development server.
You can set:
.level = ALL
In your logging.properties file. See http://code.google.com/appengine/docs/java/runtime.html#Logging for info on how to set up this file.
Related
I run my application in AppEngine (Java).
I want to use gcloud app logs command to view my application logs:
gcloud app logs tail
However, the output is just few data as below:
....
2019-10-04 12:46:43 default[api-v1-0-0] "GET / HTTP/1.1" 200
2019-10-04 12:46:43 default[api-v1-0-0] "GET / HTTP/1.1" 200
....
Actually, I expect gcloud app logs will show logs that my application printed to stdout and stderr. However, it does not.
My question is: How to get/view application stdout/stderr logs by using gcloud command?
From gcloud app logs tail:
DESCRIPTION
Streams logs for App Engine apps.
The command is designed as a blocking call primarily watching for the app logs being generated after the command is invoked (though at startup it may also display a few historical logs, generated before the command is issued).
To focus primarily on the historical logs you want to use the gcloud app logs read command:
DESCRIPTION
Display the latest log entries from stdout, stderr and crash log for
the current Google App Engine app in a human readable format.
Note that the presence of the stdout/stderr in the logs depends on the environment and runtime your app uses. For example in the 1st generation standard environment (at least for the python runtime) the messages printed directly to stdout/stderr do not show up in the logs, one has to specifically use the python logging calls.
I suspect the same might be true for Java, as I see stdout/stderr mentioned in the logging docs for Java11 (and flex environment), but not in the Java8 one.
I also could not use
> gcloud app logs tail
but i found out you can use:
gcloud logging logs list
This will return a list of log names like:
NAME
projects/intan1/logs/appengine.googleapis.com%2Frequest_log
projects/intan1/logs/cloudaudit.googleapis.com%2Factivity
Then you can call:
gcloud beta logging read logName=projects/intan1/logs/appengine.googleapis.com%2Frequest_log
This will return a log, with a lot of extra info, but maybe this can help you!
I am running a Java Microengine on GAE.
I have my own html pages for data input and output. When there is a data error and the engine cannot complete its execution (crashes) - the microengine spits out the "Response" as Server not available, please try later.
In order to debug, I run the dataset in the dev environment - as a Java application to identify the error in the console output.
Is there a way to capture the "error" (the console output equivalent when run as a Java application) - as an output string and send it as a content of the servlet response from the deployed Application in GAE..
thanks,
assuming you are using App Engine Managed VM, and a logging framework, you should also forward the log entry into a file, e.g. /var/log/app_engine/custom_logs/app.log
https://cloud.google.com/appengine/docs/managed-vms/custom-runtimes#logging
Subsequently, you'll be able to read the output from Google Cloud Logging.
I tried to set up WordPress under Google App Engine earlier tonight (following the instructions here: https://developers.google.com/appengine/articles/wordpress).
It runs fine locally, but when I push to remote I get a database error (visible at https://wp-dot-frontiermediag.appspot.com/). If we throw on a /wp_admin/install.php you get:
This either means that the username and password information in your
wp-config.php file is incorrect or we can't contact the database server
at :/cloudsql/frontiermediag:fmwp. This could mean your host's database
server is down.
Here's the relevant code in wp-config:
/** MySQL hostname */
if(isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false) {
define('DB_HOST', ':/cloudsql/frontiermediag:fmwp');
}else{
define('DB_HOST', 'localhost');
}
frontiermediag:fmwp is showing "Status Runnable" in Developers Console > Cloud SQL.
I did this once before and it worked so I'm not sure what I'm missing here. I thought it might have been because I'm using WP 3.8.1. but rolled back to 3.5.1 and same thing's happening.
Any ideas? frontiermediag is listed as an authorized application on the :fmwp ACL.
This situation happened to me earlier.However, I edited my Cloud SQL instance , and set "Preferred Location" as "Follow App Engine App" from Google Developers Console. This database connection problem was solved in my case.
I tried the instructions with wordpress 3.5.1 and the instructions seem to work for me. The code snippet you have above seems right and I am not sure what could be wrong without looking at rest of your code. Can you try the instructions from the beginning one more time with 3.5.1?
I had this issue, because "Follow App Engine App" doesn't seem to be an option for second generation instances in my case, and so the instance connection name includes the region setting.
Look at the instance details, and under properties, find "Instance connection name". That is the text that should follow :cloudsql/.
When i deploy my application in GAE , i get this error
This application does not exist (app_id=u'qsse-ss').
scenario is that this application is already deployed to GAE by some other user , now i have made some changes and i want to update in GAE, so now when i right click on my app in eclipse and go to "deploy to appengine " it gives me this error
Am i doing something wrong , whats the correct way of doing it
thanks
That happened to me as well when I provided a username that wasn't an owner/developer, and even specifying a different account with -e or --email didn't work. What fixed was this:
appcfg.py update . --no_cookies
(same as: https://stackoverflow.com/a/10004722)
You have to login under developer or owner to deploy application. This is bottom left icon in eclipse.
Also check your application name. If id of application correct and user you login has role owner/developer for this application - you will deploy.
You have to make sure that application name in your GAE local client matches the one in your Google account. Check the app.yaml file to make sure that the name of application matches there as well.
That also happend to me when I change the email to create new appid for goagent.
My solution is delete cookie file in the server directory:
rm server/.appcfg_cookies
then, everything is ok!
Deleted .appcfg_oauth2_tokens c:/usrs/etc worked for me after a long overdue upgrade to python27.
At least as of 2017-06-22, it's not enough to create a cloud project. You have to go to the App Engine section of cloud console and choose a language. When it's done saying "Preparing your App Engine services..." then you can deploy.
the problem was different name which i changed from rightClick project ->appenginesettings->ApplicationId .
this name should be same in your google account
Removing the oauth2 token file ~/.appcfg_oauth2_tokens or specifying a different token store file file with the flag "--oauth2_credential_file" might be a permanent solution. MacOSX GoogleAppEngineLauncher.app does not let you change this flag/path when you push the deploy button.
appcfg.py --oauth2_credential_file=~/.appcfg_oauth2_tokens_myappid
I had same error message:
This application does not exist (project_id=u'xxxx-123456'). To create an
App Engine application in this project, run "gcloud app create" in
your console.
I solved it by executing below command:
gcloud app create
It will create app inside your project and assign selected region.
i'm trying to upload my app engine project for the very first time and i have no clue why it is not working. the error from my terminal is:
[me][~/Desktop]$ appcfg.py update ProjectDir/
Application: tacticalagentz; version: 1
Host: appengine.google.com
Starting update of app: tacticalagentz, version: 1
Scanning files on local disk.
Error 404: --- begin server output ---
This application does not exist (app_id=u'tacticalagentz').
--- end server output ---
i'm using python 2.6.5 and ubuntu 10.04.
not sure if this is relevant, but i just created a google app engine account today. and i also just created the application today (like a couple of hours ago). this is really frustrating because i just want to upload what i have so far (as a demo). in my app.yaml this is my first line:
application: tacticalagentz
Furthermore, i checked on my admin console, and i CLEARLY see the app id right there, and it matches letter for letter with the app id in my app.yaml
could someone please enlighten me and tell me what i am doing wrong? or is it something beyond my comprehension (like indexing issue with Google that they need time to index my app id) ?
thank you very much in advance
apparently adding the "--no_cookies" parameter will work
appcfg.py update --no_cookies ProjectDir/
the way i was able to find my answer was by uploading my app from my Mac OS X (thank god i have linux mac and windows). AppEngine on Mac OS X comes with a GUI interface, and it worked for uploading. so then i found the command they used in the console, which included "--no_cookies". perhaps if you run into similar issues in the future, this is one approach to getting the answer
App Engine for Java have the same problem. The problem is about account login.
If you are using Eclipse, use Sign In button.
If u are using command-line, use "-e" option, like this:
appcfg.sh -e your#email.com update yoursite/
I had the same problem. When I changed the name of the app I used in the launcher to match the one in the app engine, It worked without any problem. The way I figured out, it was the name mismatch which caused the problem. You can see the name of your registered app in the admin console of app engine.(https://appengine.google.com/)
Here's what fixed it for me:
i had an instance of dev_appserver.py myProjDirectory/ on a different terminal.
i guess the scripts are somehow linked and aren't thread safe
An alternate option that worked for me is to just "Clear Deployment Credential" from the Control option of the GUI. When the app was deployed after this, it opened a google page to allow GAE to access the user profile and then deployment was successful.
The key bit is
This application does not exist (app_id=u'tacticalagentz').
which is telling you that appspot.com doesn't know of an application by that name. The admin console (https://appengine.google.com/) shows your applications. Check there. You might have made an inadvertent typo when you registered the app.