Google App Engine and printStackTrace-as log

0 like 0 dislike
12 views
Is there a standard way to display the Exception information.printStackTrace() in the log (in control panel) Google App Engine?

For some reason I was sure that by default there is written and actively used it. And now, you can either redo it or find how to enable.

Java work recently, please do not kick your feet.
by | 12 views

4 Answers

0 like 0 dislike
Well, actually, the standard printStackTrace writes in the System.err => must be in the application logs. You where looking at? And all from System.out / System.err is there?
by
0 like 0 dislike
Just try to rewrite the entire stack in standard logger.
\r
 try { //Some code } catch (Exception e) { for (StackTraceElement ste : e.getStackTrace()) { log.error(e.toString()); } } 
by
0 like 0 dislike
By the way, interestingly, the System.out.println("test") in the log appears. But System.out.print("test") — no. If we add in the end of line characters "\\r\" — begins to appear. Same thing with the System.err. Probably Googles fault...
by
0 like 0 dislike
In General, the solution:
\r
\r
PrintStream printStream = new PrintStream(System.err, true, "UTF-8"); exception.printStackTrace(printStream); 

\r
With Russian characters problems not seen.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
7 answers
asked Mar 23, 2019 by andruxin
110,608 questions
257,186 answers
0 comments
28,757 users