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.
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