Johann
Johann

Reputation: 29867

Where is local log file located for Google App Engine Java app

I am writing to the log with my Google App Engine (GAE) app but I cannot find where it is being stored. I have read a lot of posts on Stackoverflow but none of them indicate where to find this. I'm running my app in IntelliJ, using Gradle and IntelliJ.

Upvotes: 0

Views: 417

Answers (1)

Dan Cornilescu
Dan Cornilescu

Reputation: 39814

The logs are not stored in a plain text file, they're stored as an SQLite database. From Local Development Server Options:

--logs_path=...

By default, the logs for the local development server are stored in memory only. Specify this option when you run the local development server to store the logs into a file, which makes the logs available across server restarts. You must specify the directory path and name to a SQLite database file. A SQLite database file is created with the specified name if the file does not already exist. For example: --logs_path=/home/logs/boglogs.db

Not sure about the in-memory storage, though, I can see my devserver writing to a default db file even without setting this option explicitly (on Linux, using lsof on the PyCharm-driven devserver's PID):

$ lsof -p 22811 | grep -i log
python2.7 22811 username    4ur  REG       8,3 1648899072   1705871 /tmp/appengine.<app_name>.username/logs.db
python2.7 22811 username   24u   REG       8,3       3608   1712816 /tmp/appengine.<app_name>.username/logs.db-journal
$ file /tmp/appengine.<app_name>.username/logs.db
/tmp/appengine.<app_name>.username/logs.db: SQLite 3.x database

Note: the above are for the Python devserver, Java is a bit different, but on Linux the same method may be usable to identify the location and type of the default file holding logs. The --generated_dir option might be the one to use to overwrite the default location. From Command-Line Arguments:

--generated_dir=...

Set the directory where generated files are created.

Upvotes: 1

Related Questions