rPath Appliance Platform Agent:Logs Plugin
From rPath Wiki
|
The rPath Appliance Platform Agent (rAPA) includes a Logs plugin which is enabled by default. The plugin provides the View Logs task in the rAPA web interface. The Logs plugin supports viewing multiple log files in a variety of formats according to a specified list. Complete log files may also be downloaded via the Logs Plugin as well.
Using the Logs Plugin Interface
See the Appliance Logs page in the Appliance Administration pages for information on how to use the Logs plugin in the web interface.
Disable or Enable the Logs Plugin
To disable the Logs plugin, use logs/Logs in the plugins.disable list in the custom configuration (custom.cfg) as described in rAPA Plugin Configuration.
Appliance Developer Notes
As with some other standard rAPA plugins, appliance developers may configure certain aspects of the Logs plugin besides just enabling it for all users. The Logs plugin configuration file (/usr/lib/python2.4/site-packages/raaplugins/logs/logs.cfg) is separate from rAPA's prod.cfg configuration and contains all customizable settings specific to the Logs plugin. To package a custom Logs plugin configuration, developers can create and package a custom.cfg file as described in rAPA Plugin Configuration, and they can include a [/logs] section under the [global] section using the directives described in the following sections.
logs.num_lines
The logs.num_lines directive set the number of lines from the end of a log which are displayed in rAPA. The default value is 10, and the following is an example logs.num_lines line where the number is changed to 20:
logs.num_lines = 20
logs.files
The logs.files directive sets the name and location of log files to display. For each log to be displayed, the display name is in single quotes followed by a colon (:) and the absolute path to the log file itself, also in single quotes. The colon-separated entries for each log are separated by commas in the brace-enclosed list. The following is an example logs.files line:
logs.files = {'Compressed Example': '/var/log/app/application.tar.gz', 'Appliance Logs': None, 'Conary': '/var/log/conary', 'Agent Service': '/var/log/raa/raa-service.log', 'Agent Web Service': '/var/log/raa/web', 'System': '/var/log/messages'}
In this example, the Logs plugin interface will have the following selections from its drop-down list: Compressed Example, Appliance Logs, Conary, Agent Service, Agent Web Service, and System.
Compressed files and null (None) entries may be included for download in the logs.files list as shown in the previous example:
- Compressed files can be included for download from the Logs plugin, but the plugin does not generate compressed log files. The plugin supports the download of compressed files of the following mime types:
- tar.gz
- tgz
- Z
- bz2
- zip
- gz
- Null entries (or entries using None instead of a file path) will have name of the log in the drop-down list in ther interface, but they not contain any log file or compressed archive.
Below is an example custom.cfg file showing the logs section under global and the directives from the previous examples:
[global]
[/logs]
logs.num_lines = 20
logs.files = {'Compressed Example': '/var/log/app/application.tar.gz', 'Appliance Logs': None, 'Conary': '/var/log/conary', 'Agent Service': '/var/log/raa/raa-service.log', 'Agent Web Service': '/var/log/raa/web', 'System': '/var/log/messages'}
