Magnolia 5.4 reached end of life on November 15, 2018. This branch is no longer supported, see End-of-life policy.

Page tree
Skip to end of metadata
Go to start of metadata

The Log Tools module is a system administration tool which allows the system administrator to list, view, and download system log files such as magnolia-debug.log or magnolia-error.log, as well as to view and set specific log levels to classes. The module replaces two separate tools offered in pre-5.4.6 versions of Magnolia, the Log Viewer app and the Logging app.

 

Installing

Maven is the easiest way to install the module. Add the following dependency to your bundle:

<dependency>
  <groupId>info.magnolia.log</groupId>
  <artifactId>magnolia-log-tools</artifactId>
  <version>1.1.2</version>
</dependency>

Pre-built jars are also available for download. See Installing a module for help.

Usage

Log Tools can be accessed from the Tools area of the AdminCentral interface:

Upon clicking on the Log Tools icon, two tabbed windows will be available to the user: the Log List window, provided by the Log List subapp, and the Log Levels window, provided by the Log Levels subapp:

LOG LIST Window

Viewing and downloading log files

The Log List window allows the user to select one or more log files from the list and either to view them internally in a new tab (or tabs if more than one log file were selected), or to download them.
(warning) Please note that the internal viewer, which is provided by the Log Viewer subapp of the module, will show only the most recent log entries. Larger log files have to be downloaded and viewed in an external viewer. The Log Viewer will inform you that only a part of the log file is shown by placing the following line at the top of the viewer window:

"The output of the log file has been truncated. Download the file to see its entire content."

When downloading a log file, the file will be saved under the name that is shown in the Log List window. If downloading more than one file, the files will all be automatically compressed into a single ZIP file titled magnolia-logs.zip first and only then presented to the user through the download dialog.

Viewing and setting log levels

In the Log Levels window it is possible to view and change log levels for classes. To view the classes with a specific log error level, open the roll-down menu in the top right corner of the window and select the error level that you want to apply to the output:

Only the classes with the selected type of error level will be shown in the list. Choosing the "      " (empty) option in the roll-down menu will list classes with all the error level types:

The list of classes can be narrowed down by specifying the name of the class in the "Name" line of the Log Levels window. Typing in a name of a class or just its part, e.g. "info.ma" as shown in the image below, only those classes that match the given class name pattern will be listed:

It is also possible to change the error levels for classes in the Log Levels window. This can be done simply by doubleclicking at the line with the class name, selecting the desired level and clicking at the "Save" word:

If the class name is marked by the check-off symbol (✓) in the "Inh." column, the newly set level will be assigned also to the children of the class, which will be shown in the Log Levels window the next time the Log Tools are accessed from the AdminCentral interface.

(warning) Please note that such level changes will be transient only. Restarting Magnolia will set the error levels to their defaults. To make the changes permanent, a modification of the log4j.xml file would be necessary. The file normally resides in the /<CATALINA_HOME>/webapps/<contextPath>/WEB-INF/config/default directory.