I am struggling to get the most basic logging working.  I've even
started with the default app generated by Eclipse, adding only one
simple log command to the existing code in the GreetingServiceImpl
class.  I have not changed the WEB-INF/classes/logging.properties or
the appengine-web.xml file.  (I included their state below anyway.)

Here is the GreetingServiceImpl class:


import java.util.logging.Logger;

import com.playatomo.testbox.client.GreetingService;
import com.playatomo.testbox.shared.FieldVerifier;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

/**
 * The server side implementation of the RPC service.
 */
@SuppressWarnings("serial")
public class GreetingServiceImpl extends RemoteServiceServlet
implements
                GreetingService {

// i added this line:
        private static final Logger log =
Logger.getLogger(GreetingServiceImpl.class.getName());

        public String greetServer(String input) throws
IllegalArgumentException {

// and this line.  That is all.

                log.info("tester, tester!!!");

                // Verify that the input is valid.
                if (!FieldVerifier.isValidName(input)) {
                        // If the input is not valid, throw an 
IllegalArgumentException
back to
                        // the client.
                        throw new IllegalArgumentException(
                                        "Name must be at least 4 characters 
long");
                }

                String serverInfo = getServletContext().getServerInfo();
                String userAgent = 
getThreadLocalRequest().getHeader("User-Agent");
                return "Hello, " + input + "!<br><br>I am running " + serverInfo
                                + ".<br><br>It looks like you are using:<br>" + 
userAgent;
        }
}

Here is the logging.properties file:

# A default java.util.logging configuration.
# (All App Engine logging is through java.util.logging by default).
#
# To use this configuration, copy it into your application's WEB-INF
# folder and add the following to your appengine-web.xml:
#
# <system-properties>
#   <property name="java.util.logging.config.file" value="WEB-INF/
logging.properties"/>
# </system-properties>
#

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


And here is the appengine-web.xml file:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0";>
  <application>terriginousbox</application>
  <version>1</version>

  <!-- Configure serving/caching of GWT files -->
  <static-files>
    <include path="**" />

    <!-- The following line requires App Engine 1.3.2 SDK -->
    <include path="**.nocache.*" expiration="0s" />

    <include path="**.cache.*" expiration="365d" />
    <exclude path="**.gwt.rpc" />
  </static-files>

  <!-- Configure java.util.logging -->
  <system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/
logging.properties"/>
  </system-properties>

</appengine-web-app>

Can you help me understand why, I see no log entries when I go to the
dashboard, and look for info log entries (I have changed the Logs with
minimum severity, to include Info).

Thanks,
Ken
(just starting out here if you cannot tell!)

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to