Book Image

Wildfly Cookbook

Book Image

Wildfly Cookbook

Overview of this book

Table of Contents (23 chapters)
WildFly Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a periodic-rotating file-handler


In this recipe, we will learn how to target the log statement output of your application to a periodic file handler. This is different from the file-handler, in that when the running system reaches a pre-defined time (that is, hour change, day change, and so on), the log file rolls, backing up itself and creating a new file with the same characteristics.

For the sake of simplicity, we will try our recipe with WildFly running in the standalone mode.

Getting ready

If you didn't follow the previous recipe, we will need to create a standalone configuration for our recipe, as follows:

$ cd $WILDFLY_HOME
$ cp -a standalone std-logging

To test our logging configuration, we will need an application to log some statements. In this case, we will use the application named logging. To obtain the artifact to deploy, please refer to the Software prerequisites recipe in Chapter 1, Welcome to WildFly!.

Now, let's start WildFly, as follows:

$ cd $WILDFLY_HOME
$ ./bin/standalone...