Bug #17044

foreman-debug to collect whole newest (log)files instead of tailing all (log)files

Added by Pavel Moravec 7 months ago. Updated 7 months ago.

Status:Closed
Priority:Normal
Assigned To:Pavel Moravec
Category:foreman-debug
Target version:-
Difficulty:easy Bugzilla link:1372884
Found in release: Pull request:https://github.com/theforeman/foreman/pull/3991, https://github.com/theforeman/foreman/pull/3881
Story points-
Velocity based estimate-
Release1.14.0Release relationshipAuto

Description

(copied from #16680 - that will be reference by changes in katello, this for PR in foreman project)

Description of problem:
Currently foreman-debug truncates any (log)file it collects after 5000 lines, to shrink the size of created tarball. This causes the problem that collected logs have "gaps" in timeline, what means we lose track of events happened that time.

Assume I want to investigate some problem with relevant logs scattered in past 2 days, and these logs are kept in files A.log, A.1.log and A.2.log, each exceeding 5k lines. Then I get tails of the logfiles (plus tails of A.9999.log from very past) but dont know what happened at the beginning of say A.1.log.

So we don't collect some log records in close history while we collect some logs in very past history.

What about to rather collect all newest files, until some per-directory limit is reached?

Something like that is done in sosreport [1] where it works well.

[1] https://github.com/sosreport/sos/blob/master/sos/plugins/__init__.py#L508‚Äč

Version-Release number of selected component (if applicable):
foreman-debug-1.11.0.49-1.el7sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. Generate logfiles (i.e. production.log*) each bigger than 5k lines
2. collect foreman-debug and unpack it
3. Check what logfiles are collected

Actual results:
Currently tails of all logfiles (even 2 years old, irrelevant for current problem investigation) are collected. But head of first log-rotated logfile is missing (causing we dont know what happened yesterday morning)

Expected results:
Collected logifles completely cover past few days without a gap; older logfiles not collected.

Additional info:


Related issues

Related to Foreman - Bug #18365: foreman-answers.yaml from /usr/share stored instead of /e... New 02/02/2017
Blocks Smart Proxy - Bug #17069: foreman-debug to collect whole newest (log)files instead ... Closed 09/24/2016
Copied from Katello - Bug #16680: foreman-debug to collect whole newest (log)files instead ... Closed 09/24/2016

Associated revisions

Revision 56063713
Added by Pavel Moravec 7 months ago

Fixes #17044 - foreman-debug counts size instead lines

Added -s option to count sizes of logs/configs instead
of tailing the files, deprecating -m option

Fixes #17044

Signed-off-by: Pavel Moravec <>

Revision 45f8b472
Added by Dominic Cleal 7 months ago

refs #17044 - update foreman-debug man page for -s option change

History

#1 Updated by Pavel Moravec 7 months ago

  • Copied from Bug #16680: foreman-debug to collect whole newest (log)files instead of tailing all (log)files added

#2 Updated by Dominic Cleal 7 months ago

  • Category set to foreman-debug
  • Release deleted (3.3.0)
  • Pull request deleted (https://github.com/theforeman/smart-proxy/pull/461, https://github.com/Katello/katello-packaging/pull/297)

Please don't set Katello releases on Foreman tickets.

#3 Updated by Dominic Cleal 7 months ago

  • Blocks Bug #17069: foreman-debug to collect whole newest (log)files instead of tailing all (log)files added

#4 Updated by The Foreman Bot 7 months ago

  • Pull request https://github.com/theforeman/foreman/pull/3991 added

#5 Updated by Anonymous 7 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#6 Updated by Dominic Cleal 7 months ago

  • Release set to 1.14.0

#7 Updated by Dominic Cleal 4 months ago

  • Related to Bug #18365: foreman-answers.yaml from /usr/share stored instead of /etc/foreman-installer added

Also available in: Atom PDF