Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1361378 - [RFE] improve risk/message logging format
Summary: [RFE] improve risk/message logging format
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: preupgrade-assistant
Version: 6.8
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Petr Hracek
QA Contact: Alois Mahdal
URL:
Whiteboard:
Depends On:
Blocks: 1335121
TreeView+ depends on / blocked
 
Reported: 2016-07-29 01:23 UTC by Alois Mahdal
Modified: 2016-11-04 08:57 UTC (History)
5 users (show)

Fixed In Version: preupgrade-assistant-2.1.9-1.el6
Doc Type: Enhancement
Doc Text:
The text is taken from description which describe it. Proposal ======== For logging risks, use format: preupg.risk.MEDIUM: some risky risk For other properly logged messages, use: preupg.log.INFO: some_component: I just want to let you know This way, all properly logged messages and risks can be easily separated from leaks or errors thrown for various reasons.
Clone Of:
Environment:
Last Closed: 2016-11-04 08:57:54 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2616 normal SHIPPED_LIVE preupgrade-assistant bug fix and enhancement update 2016-11-03 16:23:38 UTC

Description Alois Mahdal 2016-07-29 01:23:39 UTC
Description of problem
======================

Currently there are two issues with logging from modules:

 *  Risks use prefix "INPLACERISK:" that is not suitable for migration
    scenarios.

 *  Other log messages use format that is hard to filter out.

Together with bug 1309491 (openscap merges stderr to stdout), this makes
it hard to catch situations when scripts leak some info outside intended.

For example, "leaking" grep as in bug 1356811, sntax errors or errors
thrown by external utilities called by modules are all problems
that could be easily checked by tests *if* the formatting was more
filtering-friendly.


Proposal
========

For logging risks, use format:

    preupg.risk.MEDIUM: some risky risk

For other properly logged messages, use:

    preupg.log.INFO: some_component: I just want to let you know

This way, all properly logged messages and risks can be easily separated
from leaks or errors thrown for various reasons.

(I'm planning to add this to preupg wrapper in our Beakerlib testing library
so these problems will be much more easy to spot.)

Comment 1 Alois Mahdal 2016-07-29 01:31:54 UTC
aaand... pull request (not tested!):

https://github.com/upgrades-migrations/preupgrade-assistant/pull/122

Comment 3 Petr Hracek 2016-08-15 10:03:36 UTC
Yeah, it can be added into this release path. 

Can we remove 'preupg.' before logs. I don't thing it is really needed.

Comment 4 Alois Mahdal 2016-08-15 10:33:51 UTC
(In reply to Petr Hracek from comment #3)
> Yeah, it can be added into this release path. 
> 
> Can we remove 'preupg.' before logs. I don't thing it is really needed.

The reason why there's ^preupg. is that it reliably distinguishes messages from modules from amy other possible messages dropped by any tools/scripts called from that.

Which was kinda the main point of this RFE (second bulltet point in comment 0).

Comment 5 Alois Mahdal 2016-08-15 10:33:52 UTC
(In reply to Petr Hracek from comment #3)
> Yeah, it can be added into this release path. 
> 
> Can we remove 'preupg.' before logs. I don't thing it is really needed.

The reason why there's ^preupg. is that it reliably distinguishes messages from modules from amy other possible messages dropped by any tools/scripts called from that.

Which was kinda the main point of this RFE (second bulltet point in comment 0).

Comment 6 Petr Hracek 2016-08-15 12:25:29 UTC
Well, after a discussion I will implemented in the next release cycle.
I have a lot of other issues which are urgent from preupgrade-assistant point of view.

Comment 7 Alois Mahdal 2016-08-30 19:39:23 UTC
(In reply to Petr Hracek from comment #6)
> Well, after a discussion I will implemented in the next release cycle.
> I have a lot of other issues which are urgent from preupgrade-assistant
> point of view.

Finally this has been included in last build (2.1.9-1.el6) anyway.  We have coverage for it.  It works fine.

I think universe is trying to tell us something.

(Granting qa_ack).

Comment 10 Alois Mahdal 2016-09-12 13:30:58 UTC
Test library has been updated to parse errors and risks based on the new format.  That code is used extensively, and we also have tests for Bash logging API.

IOW, the fact that almost all tests are not failing right now is proof that this has been implemented correctly.

Comment 12 errata-xmlrpc 2016-11-04 08:57:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2616.html


Note You need to log in before you can comment on or make changes to this bug.