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

Listing and reading log files


In this recipe, we will learn how to list and read log files. This can be helpful when you have access only to the CLI (which might be a remote one), and not to the server itself or the file system hosting the log files.

Getting ready

To fully understand this recipe, you should have followed one of the previous recipes, which have created the various log files. However, the standard WildFly log file server.log would be present and it's enough.

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. Before reading a file, we need to know which log files are present. To list them all, execute the following commands:

    [standalone@localhost:9990 /] /subsystem=logging:list-log-files
    {
      "outcome" => "success",
      "result" => [
        {
          "file-name" => "server.log",
          "file-size" => 24879L,
          "last-modified-date" => "2015-05-24T15:14:29.000+0200...