Google App Engine - Can not find my logging messages
Asked Answered
D

4

28

I can not find the results of my logging calls. To log messages I tried both:

System.out.println("some message"); 

and

Logger logger = Logger.getLogger("MyLogger"); // Logger is java.util.logging.Logger 

// ... 

logger.info("some message"); 

I have deployed my app and after few tests I decided check out some log messages. But there were no messages. I changed minimum severity level to "Info" from default "Error", and only messages i've seen were service messages like this:

http://dl.dropbox.com/u/1678938/logs.png

I would also be grateful if someone show a little snippet with logging some data (if it's works) - I suspect my problem may be the one of that stupid problems when somewhat incorrectly located comma can be the cause of situation.

Dailey answered 30/10, 2010 at 19:40 Comment(5)
Did you click the + signs next to those log messages to expand them? As displayed, it's impossible to tell if things you logged are actually in the log.Swerve
yes, i clicked +'es - there're was nothing similar with the info, i logged in my app. Only "dummy" strings describing some requests to the appDailey
Are you looking at the logs for the correct version of your app? It is possible that you deployed to version X but are looking at the logs for version Y.Thrice
before posting my problem here i had only one version. Now i'm trying out different versions, changing logging techiques, but with no results yetDailey
I also have this problem. I am unable to see my logging messages. Even exceptions. Stuck with it.Ypres
D
12

Problem has shrunk into more concrete form - App Engine "eats" info-messages, but shows others, such as error and warning messages.

After this call I have eventually seen my info messages:

log.setLevel(Level.INFO);

But it is still not clearly - why info-messages weren't being shown. Google's manual states:

Everything the servlet writes to the standard output stream (System.out) and standard error stream (System.err) is captured by App Engine and recorded in the application logs. Lines written to the standard output stream are logged at the "INFO" level, and lines written to the standard error stream are logged at the "WARNING" level.

Dailey answered 31/10, 2010 at 0:8 Comment(1)
Except this decision I found one more way - try to edit file WEB-INF/logging.properties. It has only one string - you should chahge WARNING level to INFO (or somewhat else)Dailey
S
27

Could it be that your logging.properties is setting the default value to WARNING?

Ours has this in our war/WEB-INF/logging.properties file:

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

# Default level for subpackages of 'server' will be INFO
com.company.whatever.server.level=INFO
Scorn answered 10/5, 2012 at 15:37 Comment(0)
D
12

Problem has shrunk into more concrete form - App Engine "eats" info-messages, but shows others, such as error and warning messages.

After this call I have eventually seen my info messages:

log.setLevel(Level.INFO);

But it is still not clearly - why info-messages weren't being shown. Google's manual states:

Everything the servlet writes to the standard output stream (System.out) and standard error stream (System.err) is captured by App Engine and recorded in the application logs. Lines written to the standard output stream are logged at the "INFO" level, and lines written to the standard error stream are logged at the "WARNING" level.

Dailey answered 31/10, 2010 at 0:8 Comment(1)
Except this decision I found one more way - try to edit file WEB-INF/logging.properties. It has only one string - you should chahge WARNING level to INFO (or somewhat else)Dailey
B
8

Had exactly the same problem and after changing the value in logging.properties from

.level = WARNING

to

.level = INFO

The problem was definitively fixed. Google needs to update their documentation and/or change the value of the supplied default so that "INFO" log messages don't get swallowed.

Bilk answered 20/6, 2013 at 17:20 Comment(1)
Agree with the Google doc sentiment. And, to elaborate, the different, dependent pieces need to be documented together with all the sample code, configuration, etc.Dihydrostreptomycin
T
0

I used to set LEVEL to SEVERE for testing

 logger.log(Level.SEVERE, "test message");

It does not need changing any value in logging.properties

Tunisia answered 18/9, 2014 at 12:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.