--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
System.out.println("Checking values for this routine");
to end up in a log file using Logback or even to get Java exceptions to end up in a log file.Thanks for your response. It's not clear to me how to get Java statements like:to end up in a log file using Logback or even to get Java exceptions to end up in a log file.System.out.println("Checking values for this routine");I've read the Play documentation page that you suggested but I don't see the solution there.Any suggestions?
Yeah, don't use System.out.*. Use Logger, of ALogger to log something. That's where those classes are for. Then you configure in detail what happens to the stuff it generates..
public class Global extends GlobalSettings {
......
public Promise<Result> onError(RequestHeader request, Throwable t) {
return Promise.<Result>pure(internalServerError(
Logger.error(t);
));
}
.........
}public Promise<Result> onError(RequestHeader request, Throwable t) {
Logger.error("Request: " + request + " Location: " + t.toString());
return Promise.<Result>pure(internalServerError(
views.html.errorPage.render(t, request.toString())
));
}@(t: Throwable, rh: String)
@import helper._
@import views.html.helper._
@main(Messages("An Exception Occurred - Doh!")) {
<h1>AN ERROR OCCURRED! </h1>
<p></p>
<strong>An error occurred that we could not prevent. We are sorry about that. The details of the error are below. Perhaps you could send it to us?</strong>
<h3>The Details Should Be Below</h3>
<h4>error message:</h4>
@t.getMessage
<h4>location:</h4>
@t.toString
<h4>request:</h4>
@rh
}