OK, I've figured out my logging problem. The Oracle Java 7 docs say[1] to 
use Logger.getGlobal() but the Google java-docs-samples code uses 
Logger.getLogger(ClassName.class.getName()). I was using the former which 
fails silently.

It would be nice if this was documented somewhere, or if any of the code 
snippets in the documentation actually used log messages.

Cheers,

John :^P

[1] 
https://docs.oracle.com/javase/7/docs/api/java/util/logging/Logger.html#global

On Tuesday, 29 December 2015 21:56:04 UTC, John Pallister wrote:

Hello list,
>
> After finally getting my "Hello World" web app working in the App Engine 
> development server I've uploaded it to the cloud and immediately struck 
> problems.
>
> The main problem is that I'm not seeing my java.util.logging.Logger log 
> messages (from either my Java or Lisp code) in the App Engine console. I've 
> set ".level=FINER" in my logging.properties file but I don't see any of the 
> messages I see using the development server, apart from a single INFO-level 
> message saying "Startup completed in -0.001 seconds.", sent to stdout.
>
> The other message I do see is an exception from my code, which suggests 
> that either the servlet's init method hasn't been called or it couldn't 
> read the context-param values from the web.xml file (via 
> GenericServlet.getInitParameter()). I wondered whether I should've used 
> system-properties in my appengine-web.xml file instead of context-param 
> elements in web.xml; I'm now checking both, to no apparent effect. But I 
> could debug this if I had my log messages.
>
> In the same log message as the exception there is also the text 
> "javax.servlet.ServletContext log: unavailable" which must be a clue, but 
> Google doesn't throw up any obvious leads for it.
>
> I have added a dirt-simple "Hello World" servlet to my application that 
> calls log.severe() and log.info() to try and get any log messages to 
> appear in the Google Cloud Platform Console Log Viewer (or the legacy 
> AppEngine Log Viewer). On running this I don't get the "log: unavailable" 
> message but I don't get any log messages either.
>
> I can't help the feeling I'm missing something obvious; as I said, this 
> all works fine in the development server (I'm using Java 7 on OS X 10.9). 
> Where do people go to see their Java log messages in the Google Cloud 
> Platform Console?
>
> Cheers,
>
> John :^P
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/1c4d79e7-ae49-495b-9efa-15b7b1fded20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to