A big difference in production environments is the logging aspect. When testing your application locally, you start it via play start
or play test
and check the console output every now and then. On production system the application is started with play run
and forked into the background from then on. Log output is written to the logs directory inside the application.
As the default log4j configuration in Play logs to the console, you should always go with a custom log4j file in production deployments.
There are several possibilities to do log rotation because it is being built into log4j. However, the most common ones are either rotating if the file has reached a certain limit, or does daily log rotation. This example works for file size based rotation:
log4j.rootLogger=ERROR, Rolling log4j.logger.play=INFO # default log level log4j.appender.Rolling=org.apache.log4j.RollingFileAppender log4j.appender.Rolling.File=logs/application.log log4j...