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 file-handler logging


The logging subsystem is where you configure the output information statements of your application and/or WildFly cores, for debugging or auditing purposes. In this recipe, we will learn how to target the log statement output of your application to a file-handler.

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

Getting ready

First of all, let's 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.sh -Djboss.server.base.dir=$WILDFLY_HOME/std-logging

How to do it...

  1. With a running WildFly server, open your command-line tool and connect...