Bug 1136361

Summary: define new log level for caught exception tracebacks
Product: Red Hat Satellite Reporter: Tomas Lestach <tlestach>
Component: TransitionsAssignee: Tomas Lestach <tlestach>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.4CC: ggainey, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 09:11:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomas Lestach 2014-09-02 12:27:11 UTC
Description of problem:
Currently exception tracebacks get logged on the info level.

That means, if the user runs the hammer import command with --verbose option, he would see the exception tracebacks on the console as well. Tracebacks are not what the user would like to see, if he likes the cmd to be more verbose.

Let's introduce a new logging level, that logs just to the logging file and never to the console.

Comment 2 Grant Gainey 2015-02-12 21:41:05 UTC
Created PR#15

Comment 3 Tomas Lestach 2015-04-10 17:05:06 UTC
hammer-cli-import.git: 6a30cce13ae85f23268919fec99548247f40a2a0

Comment 4 Grant Gainey 2015-04-10 18:03:39 UTC
katello and related projects use POST when committed upstream, and reserves MODIFIED for committing downstream.

Comment 7 Lukas Pramuk 2016-05-09 15:30:58 UTC
VERIFIED.

@Sat6.2.0-Beta
tfm-rubygem-hammer_cli_import-0.10.23-1.el6sat.noarch

In the reproducer I used an existing bug of AK import:

# hammer import activation-key --verbose --csv-file activation-keys.csv
..
Creating new ak content view: ak_1
Caught RestClient::InternalServerError:500 Internal Server Error while processing activation key 1
Creating new ak content view: ak_2
Caught RestClient::InternalServerError:500 Internal Server Error while processing activation key 2
Creating new ak content view: ak_3
Caught RestClient::InternalServerError:500 Internal Server Error while processing activation key 3
...

# less /root/import.log
...
I, [2016-05-08T18:08:16.029648 #130171]  INFO -- : Creating new ak content view: ak_1
E, [2016-05-08T18:08:16.153472 #130171] ERROR -- : Caught RestClient::InternalServerError:500 Internal Server Error while processing activation key 1
E, [2016-05-08T18:08:16.153611 #130171] ERROR -- : /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
/opt/rh/rh-ruby22/root/usr/share/ruby/net/http.rb:853:in `start'
...
I, [2016-05-08T18:08:18.126619 #130171]  INFO -- : Creating new ak content view: ak_2
E, [2016-05-08T18:08:18.230111 #130171] ERROR -- : Caught RestClient::InternalServerError:500 Internal Server Error while processing activation key 2
E, [2016-05-08T18:08:18.230250 #130171] ERROR -- : /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
/opt/rh/rh-ruby22/root/usr/share/ruby/net/http.rb:853:in `start'
...
I, [2016-05-08T18:08:20.167749 #130171]  INFO -- : Creating new ak content view: ak_3
E, [2016-05-08T18:08:20.288058 #130171] ERROR -- : Caught RestClient::InternalServerError:500 Internal Server Error while processing activation key 3
E, [2016-05-08T18:08:20.288196 #130171] ERROR -- : /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
/opt/rh/rh-ruby22/root/usr/share/ruby/net/http.rb:853:in `start'
...

>>> new logging level was introduced, verbose output shows one line error while import log show a full stacktrace

Comment 9 errata-xmlrpc 2016-07-27 09:11:05 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://access.redhat.com/errata/RHBA-2016:1501