Red Hat Bugzilla – Bug 1136361
define new log level for caught exception tracebacks
Last modified: 2016-07-27 05:11:05 EDT
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.
Created PR#15
hammer-cli-import.git: 6a30cce13ae85f23268919fec99548247f40a2a0
katello and related projects use POST when committed upstream, and reserves MODIFIED for committing downstream.
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
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