I am using java.util.logging.Logger
to do my logging on my Java GoogleAppEngine app. This works peachily when the app is deployed. However, I am unable to see my log messages when running my app in the development server.
Salient additional details:
Has anyone gotten logging working in development mode (with or without using AppEngine in conjunction with the GWT development mode container)? Is there some magic incantation I need to see my logging output?
I had the same problem yesterday, but now it works for me.
Not sure what the change was, but I will post my configuration below so you can try it out (running GAE 1.3.8, no GWT but shouldnt matter).
Please note that the logs will appear in the console window (amongst the other server logging). I am not sure you can get it to log to files since the server is running in some kind of sandbox. I have only tested this configuration in my local environment, not uploaded.
WEB-INF/appengine-web.xml:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<!-- (omitted application,version from sample-->
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
</appengine-web-app>
WEB-INF/logging.properties:
# Set the default logging level for all loggers to WARNING
#.level = WARNING
#.level = ALL
.level = INFO
logtest.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import=" java.util.logging.Logger"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="sv" xml:lang="sv">
<head>
</head>
<%
Logger logger = Logger.getLogger("org.whatever.Logtest");
logger.info("logtest info");
logger.warning("logtest warning");
logger.severe("logtest severe");
%>
<body>
Check the console for logging
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With