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.
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.
With a running WildFly server, open your command-line tool and connect to the CLI:
$ ./bin/jboss-cli.sh --connect [standalone@localhost:9990 /]
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...