diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2023-03-20 10:56:11 -0400 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2023-03-20 12:08:50 -0400 |
commit | af663ecaf6dc7244a5f455d551877c9f6d47f392 (patch) | |
tree | a0fcb4d0b5c7a97c310dfceead59eee50c1747ee | |
parent | 69cc08ed99ccb937e26727cbe336c4cc1ac71863 (diff) | |
download | sos-af663ecaf6dc7244a5f455d551877c9f6d47f392.tar.gz |
[logs] Fix loading of CosLogs variant for every distro
Previously, the way the distro tags were applied to the `Logs` and the
`CosLogs` variant, the `CosLogs` plugin would be used for every
distribution.
Fix this by separating an `IndependentLogs` class and marking the actual
plugin content as a "base" plugin to build upon, and have the `CosLogs`
plugin continue to subclass the base plugin, without inheriting the
`IndependentPlugin` subclass.
Do this rather than folding the `CosLogs` plugin and `log_days` option
back into the main `Logs` class as CoS seems to prefer an exported
binary journal rather than the standard text output favored by other
distributions.
Closes: #3166
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/report/plugins/logs.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sos/report/plugins/logs.py b/sos/report/plugins/logs.py index 180c062d..8414503f 100644 --- a/sos/report/plugins/logs.py +++ b/sos/report/plugins/logs.py @@ -10,7 +10,7 @@ import glob from sos.report.plugins import Plugin, PluginOpt, IndependentPlugin, CosPlugin -class Logs(Plugin, IndependentPlugin): +class LogsBase(Plugin): short_desc = 'System logs' @@ -102,7 +102,23 @@ class Logs(Plugin, IndependentPlugin): ) -class CosLogs(Logs, CosPlugin): +class IndependentLogs(LogsBase, IndependentPlugin): + """ + This plugin will collect logs traditionally considered to be "system" logs, + meaning those such as /var/log/messages, rsyslog, and journals that are + not limited to unit-specific entries. + + Note that the --since option will apply to journal collections by this + plugin as well as the typical application to log files. Most users can + expect typical journal collections to include the "full" journal, as well + as journals limited to this boot and the previous boot. + """ + + plugin_name = "logs" + profiles = ('system', 'hardware', 'storage') + + +class CosLogs(LogsBase, CosPlugin): option_list = [ PluginOpt(name="log_days", default=3, desc="the number of days logs to collect") |