Logging setup and rotate

To configure the logging for Apache TomEE, edit the $TOMEE_HOME/conf/logging.properties file. The file works with handlers like this:

1catalina.org.apache.juli.AsyncFileHandler.level = FINE1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.

So, you can define the logging level, directory, and prefix according to your needs.

If you need to configure log rotation, just add these lines to your handler:

1catalina.org.apache.juli.AsyncFileHandler.limit = 10241catalina.org.apache.juli.AsyncFileHandler.count = 10

In this example, we are defining this file to rotate on every 1024 kilobytes (1 MB) and keep the last 10 files on our disk.

Get Java EE 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.