Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1623090 - Setting --foreman-logging-level via installer doesn't affect the log level of /var/log/foreman/production.log
Summary: Setting --foreman-logging-level via installer doesn't affect the log level of...
Keywords:
Status: CLOSED DUPLICATE of bug 1698943
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installation
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Sanket Jagtap
URL:
Whiteboard:
Depends On:
Blocks: 1122832 1619394
TreeView+ depends on / blocked
 
Reported: 2018-08-28 13:00 UTC by Ivan Necas
Modified: 2023-09-07 19:20 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-20 07:55:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1619594 0 high CLOSED Older logging.yaml file breaks upgrade to satellite 6.4 2023-09-07 19:18:46 UTC
Red Hat Knowledge Base (Solution) 3754291 0 None None None 2018-12-13 13:41:15 UTC

Internal Links: 1619594

Description Ivan Necas 2018-08-28 13:00:24 UTC
Description of problem:

Setting --foreman-logging-level via installer doesn't affect the log level of /var/log/foreman/production.log

The installer produced the following config and it doesn't affect the final log level
------
:logging:
  :level: debug
  :production:
    :type: file
    :layout: pattern
------

This is the format that actually works:
------
:logging:
  :production:
    :type: file
    :layout: pattern
    :level: debug
------

Version-Release number of selected component (if applicable):
Sat 6.4

Comment 1 Ivan Necas 2018-08-28 13:27:04 UTC
See https://bugzilla.redhat.com/show_bug.cgi?id=1619594#c13 for more details.

Comment 6 Stephen Wadeley 2019-08-15 10:50:07 UTC
Hello

checking on Sat6.6

default:

  logging_level: info
  logging_type: file
  logging_layout: pattern
  loggers: {}


after running 
[root@sat-6-6-qa-rhel7 ~]# satellite-installer --foreman-logging-level debug

  logging_level: debug
  logging_type: file
  logging_layout: pattern
  loggers: {}


Seems the layout has changed, as a result of a fix I presume. I can check in 6.5 too.

We have this bug for 6.4


Bug 1698943 - Logging level change does not take any effect (6.4 only)

I see lzap says[1] there: "this is fixed in 6.5."

So I think we could close this as a duplicate of that bug. No harm to test on 6.5 quick.


[1] https://bugzilla.redhat.com/show_bug.cgi?id=1698943#c3

Comment 7 Stephen Wadeley 2019-08-15 11:17:32 UTC
Hello

Works in 6.5


Before:
[root@sat-6-5-qa-rhel7 ~]# grep -C4 logging /etc/foreman-installer/scenarios.d/satellite-answers.yaml
  ipa_manage_sssd: true
  websockets_encrypt: true
  websockets_ssl_key: /etc/pki/katello/private/katello-apache.key
  websockets_ssl_cert: /etc/pki/katello/certs/katello-apache.crt
  logging_level: info
  logging_type: file
  logging_layout: pattern
  loggers: {}


[root@sat-6-5-qa-rhel7 ~]# satellite-installer --foreman-logging-level debug


After:

[root@sat-6-5-qa-rhel7 ~]# grep -C4 logging /etc/foreman-installer/scenarios.d/satellite-answers.yaml
  ipa_manage_sssd: true
  websockets_encrypt: true
  websockets_ssl_key: /etc/pki/katello/private/katello-apache.key
  websockets_ssl_cert: /etc/pki/katello/certs/katello-apache.crt
  logging_level: debug
  logging_type: file
  logging_layout: pattern
  loggers: {}


As comment 0 specifically mentions 6.4 we could close this as duplicate of:

Bug 1698943 - Logging level change does not take any effect (6.4 only)

Although that bug is newer its had more activity.

But component is different, so lets ask lzap how to proceed.


Thank you

Comment 8 Stephen Wadeley 2019-08-16 09:46:32 UTC
(In reply to Stephen Wadeley from comment #6)
> Hello
> 
> checking on Sat6.6
<snip>
> 
> 
> Seems the layout has changed, as a result of a fix I presume. I can check in
> 6.5 too.
> 
Sorry, I was looking at the answer file extract, 
this is what I should have posted:

From 6.6 latest snap

This is extract of /etc/foreman/settings.yaml with default setting:

# Log settings for the current environment can be adjusted by adding them
# here. For example, if you want to increase the log level.
:logging:
  :level: info
  :production:
    :type: file
    :layout: pattern



Now after running:
 ~]# satellite-installer --foreman-logging-level debug


 ~]# grep -r -A7 "Log settings" /etc/foreman/settings.yaml
# Log settings for the current environment can be adjusted by adding them
# here. For example, if you want to increase the log level.
:logging:
  :level: debug
  :production:
    :type: file
    :layout: pattern



This is extract from logs after running hammer host list on Sat6.6

I for Info, D for Debug. app is 2Main application logger"

2019-08-16T11:40:15 [I|app|f00c1f3f] Started GET "/api/hosts?page=1&per_page=1000" for 10.37.192.23 at 2019-08-16 11:40:15 +0200
2019-08-16T11:40:15 [I|app|f00c1f3f] Processing by Api::V2::HostsController#index as JSON
2019-08-16T11:40:15 [I|app|f00c1f3f]   Parameters: {"page"=>"1", "per_page"=>"1000", "apiv"=>"v2", "host"=>{}}
2019-08-16T11:40:15 [D|app|f00c1f3f] Authenticated user admin against INTERNAL authentication source
2019-08-16T11:40:15 [D|app|f00c1f3f] Current user set to foreman_admin (admin)
2019-08-16T11:40:15 [I|app|f00c1f3f] Authorized user admin(Admin User)
2019-08-16T11:40:15 [I|app|f00c1f3f] Current user set to admin (admin)
2019-08-16T11:40:15 [D|app|f00c1f3f] Current location set to none
2019-08-16T11:40:15 [D|app|f00c1f3f] Current organization set to none
2019-08-16T11:40:15 [D|app|f00c1f3f] Current location set to none
2019-08-16T11:40:15 [D|app|f00c1f3f] Current organization set to none
2019-08-16T11:40:15 [I|app|f00c1f3f]   Rendering api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout
2019-08-16T11:40:15 [I|app|f00c1f3f]   Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (50.0ms)
2019-08-16T11:40:15 [D|app|f00c1f3f] Body: {
  "total": 4,
  "subtotal": 4,
  "page": 1,
  "per_page": 1000,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },

so it works on 6.6, I need to test 6.5 again

Comment 9 Stephen Wadeley 2019-08-16 10:57:02 UTC
further to comment 8

I confirm this works on Sat6.5, I see the same output in /var/log/foreman/production.log after enabling debug using the installer script.

thank you

Comment 10 Lukas Zapletal 2019-08-16 11:07:38 UTC
So I guess I don't need to comment then :-) Cheers.

Comment 11 Stephen Wadeley 2019-08-20 07:55:19 UTC

*** This bug has been marked as a duplicate of bug 1698943 ***


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