Configure logging in Google App Engine

Google App Engine for Java is using java.util.logging.Logger to perform the logging. In this tutorial, we show you how to do logging in GAE environment.

1. Logging Example

Example to define a logger in MovieController, and log the messages in different logging levels (info, warning and error)

import java.util.logging.Logger;
public class MovieController {
private static final Logger log = Logger.getLogger(MovieController.class.getName());
@RequestMapping(value="/{name}", method = RequestMethod.GET)
public String getMovie(@PathVariable String name, ModelMap model) {"Information log message.");
log.warning("Warning log message.");
log.severe("Error log message.");
return "page";

2. Logging Example

Create a file,, set the logging level, and put it in “$project/war/WEB-INF

File : $project/war/WEB-INF/

# Set the default logging level for all loggers to WARNING
.level = WARNING

3. appengine-web.xml

Update appengine-web.xml, define system properties tag, and point logging to above “WEB-INF/“.

File : $project/war/WEB-INF/appengine-web.xml

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="">
<!-- Configure java.util.logging -->
<property name="java.util.logging.config.file" value="WEB-INF/"/>

4. Done

In GAE local development environment, all logged message will be display on console. In GAE production environment, you can access the logged messages in your application’s administrator page.

gae java logging gae java logging

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s