19.39. listlogfiles

Displays a list of the log files in the catalina.home path. If you need to explicitly set the log file path, you can use the logdir setting in the main.cf configuration file.

You can specify the sorting column(s) by a semicolon-separated list of column numbers in the -s option. Allowed are values 1, 2, and 3 for the first (filename), second (last modified) and third (size) columns, respectively. If you need to sort a given column in descending order, you can enter a - prefix in front of the column's index. Default sorting is by filename (ascending order).

Further, you can use Java regular expressions (https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html) for filtering files.

The example below lists all log files starting with ''reportserver'' and sorting them by size in descending order.

listlogfiles -s -3 -f "reportserver.*"

The example below lists all log files starting with ''reportserver'' and sorting them by size in descending order, followed by filename in ascending order.

listlogfiles -s -3;1 -f "reportserver.*"

Further, you can use the -e option if you want to send the (filtered) log files via e-mail. For example, the following allows you to ZIP and send all log files starting with ''reportserver'' to the current user via e-mail.

listlogfiles -s -3;1 -f "reportserver.*" -e

If you need to send the (filtered) log files to any datasink, you can use the -d option for this. You can use any object resolver query to locate the specific datasink. Refer to Section 15.5. Object Resolver for more details of object resolver queries. For example, the following allows you to ZIP and send all log files starting with ''reportserver'' to the datasink with id 123.

listlogfiles -s -3;1 -f "reportserver.*" -d id:DatasinkDefinition:123

Note that you can display the last n lines of a given log file with the viewlogfile command described in Section 19.69. viewlogfile.

Use: listlogfiles [-s] [-f] [-e] [-d]