Trace log stack in prod mode using Play apps

When the Play application encounters a 500 error while running in production mode, it logs the error as follows:

[TIMESTAMP]: @[errorid] [TIMESTAMP]: Internal Server Error (500) for request GET /path-to-request [TIMESTAMP]: Execution exception (In /app/controllers/Controller.java around line 55) 

No stack trace is enabled. Is it possible to configure Play to track the stack trace?

Bonus question: is it possible to limit the size of the stack trace in the logs to, say, 20 lines in order to prevent the growth of the escape log?

+4
source share
2 answers

By default, you cannot limit the output of the log, but you can set log4j.properties and add a log file.

In this error, the log itself talks about the reason: (In / app / controllers / Controller.java near line 55). If you are in development mode and trying to access this URL, you will receive an error report.

I assume that you have replaced the real path with "/ path-to-request". If the cause is not likely, this path may not exist at all in your routes file.

+2
source

I can not find any restrictions for the log, which depends on the PROD mode. I would recommend debugging the error and looking in the framework code.

0
source

All Articles