Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the logging format in Google AppEngine

AppEngine uses JUL for its logging and I have configured the logging.properties file and reference to that in appengine-web.xml

The problem is that the format that AppEngine presents the data in the console log gets truncated after about 180 chars on each log line. And since a large part of that is taken up with the method and class name (including package) and date there isn't much of the actual log message that comes out.

I have tried to configure my own Formatter, both programatically and via logging.properties without luck.

I realise that I could push all my log through slf4j, logback or log4j but I believe that doing so causes all such log to appear as stdout in the AppEngine log console which has its own style of verbosity.

Is there a way to define a particular format for the AppEngine log and if so how? t would be enough if each log line wasn't getting truncated to 180 chars.

like image 395
William Avatar asked Oct 01 '12 06:10

William


1 Answers

Have you tried using the log download feature: It does not truncate the logs, you get to see everything, and can specify the number of days and severity of which log entries to download.

C:\eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.7.2.1\appengine-java-sdk-1.7.2.1\bin>appcfg.cmd --severity=DEBUG --num_days=2 request_logs C:\workspace\my_app\war C:\workspace\MY_LOGS.TXT

<path to SDK>/appcfg.cmd --severity=DEBUG --num_days=2 request_logs <path to war> <path to log>

That is the only way I found to be able to see my log details. The default log level is INFO, so you really have to use the severity and num_days arguments for it to be useful.

Additionally, if you want to download the logs for a backend, then you need to specify the backend version using the following option on the command line. Where worker is the name of the backend.

 --version=worker
like image 90
Greg Pastik Avatar answered Sep 21 '22 14:09

Greg Pastik