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

Defining asynchronous handlers


In this recipe, you will learn how to target the log statement output of your application to a handler of your choice and have it logging in an asynchronous way. For the sake of simplicity, we will try our recipe with WildFly running in the standalone mode.

Getting ready

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

Furthermore, this recipe relies on the configuration made while explaining the Creating a file-handler logging and Creating a periodic-rotating file-handler recipes of this chapter.

How to do it…

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

    $ ./bin/jboss-cli.sh--connect
    [standalone@localhost:9990 /]
  2. Now execute the following commands:

    [standalone@localhost:9990 /] /subsystem=logging/async-handler=wildflycookbook...