Bug 1402987

Summary: Unable to limit the logging level of goferd service to Error.
Product: Red Hat Satellite Reporter: Deepannagaraj Nagarathinam <dnagarat>
Component: katello-agentAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.4CC: aperotti, bbuckingham, daniele, dcaplan, dnagarat, jcallaha, jortel, richie.markham, stbenjam
Target Milestone: UnspecifiedKeywords: PrioBumpPM, Reopened, Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-05 18:45:31 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:

Description Deepannagaraj Nagarathinam 2016-12-08 20:02:54 UTC
Description of problem:

- After changing the logging level in the agent.conf file, still, the goferd service captures the INFO messages to the logs.

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

- Red Hat Satellite v 6.2.4
- gofer-2.7.6-1.el7sat.noarch

How reproducible:

- Always

Steps to Reproduce:

-> Register a client to Satellite 6.2 server and install the katello-agent on it.

-> Edit the "/etc/gofer/agent.conf" file and change the logging level to "error".

-> Restart the goferd service.

Actual results:

- Goferd service is still capturing the INFO logs.

Expected results:

- Goferd service should only log the ERROR messages.

Additional info:

------
# grep ^gofer /etc/gofer/agent.conf
gofer.agent=error
gofer.messaging=error
------

==> /var/log/messages <==

Dec  2 12:15:57 client ?<30>goferd: [INFO][worker-0] root:490 - connecting to satellite.example.com:5647...
Dec  2 12:15:57 client ?<30>goferd: [INFO][worker-0] root:512 - connected to satellite.example.com:5647

Comment 1 Deepannagaraj Nagarathinam 2016-12-08 20:09:31 UTC
Hi,

As a workaround, we can comment out the logging level code in the logutil.py file.

------
# cat /usr/lib/python2.7/site-packages/gofer/agent/logutil.py
<snipped>
        handler.setFormatter(FORMATTER)
        root = getLogger()
        #root.setLevel(INFO)  ## Comment out this line
        root.handlers.append(handler)
</snipped>
------

and then restart the goferd service.

Regards, Deepannagaraj N.

Comment 3 Jeff Ortel 2017-01-10 23:30:24 UTC
The [logging] section configures the python logging and needs to be expressed using python package names.  Suggest:
  
  [logging]
+ gofer=error
+ pulp=error
+ katello=error
  # gofer.agent=debug
  # gofer.messaging=debug

Comment 13 RichieM 2017-06-20 13:31:41 UTC
Can you please explain why this is considered not a bug?

This looks like hardcoding:
#root.setLevel(INFO)  ## Comment out this line

And better defaults on agent.conf should be deployed for the sake of minimizing syslog spam otherwise actionable items get missed.

Comment 14 Daniele Palumbo 2017-08-01 00:03:26 UTC
Hi,

as by solution linked, i totally agree with RichieM.
Please reopen the bug and provide a decent explanation.

Comment 15 Deepannagaraj Nagarathinam 2017-08-01 01:02:44 UTC
Hi RichieM and Daniele,

I have updated the article with the actual solution. 

Could you please try that? Let us know the results.

Regards,
Deepannagaraj N.

Comment 16 RichieM 2017-08-01 12:36:54 UTC
Is this portion still required:
edit /usr/lib/python2.7/site-packages/gofer/agent/logutil.py
#root.setLevel(INFO)  ## Comment out this line

Comment 17 Deepannagaraj Nagarathinam 2017-08-02 02:03:35 UTC
Hi RichieM,

I hope that is not needed anymore. You may uncomment that line and restart the goferd to take effects.

Deepannagaraj N.

Comment 19 Brad Buckingham 2017-09-27 22:02:18 UTC
Removing the needinfo based upon the updates provided by Deepannagaraj.

At this time, the config file that is being changed via the article comes from a package that is controlled by gofer.  As a result, changing the default as not as simple as it may seem.  That said, it could be changed post install and managed via puppet or the configuration management solution of choice.

Comment 22 Deepannagaraj Nagarathinam 2017-11-14 20:44:59 UTC
Hello Brad,

Yeah, I have tried the latest version (katello-agent and gofer packages also latest). But it didn't work.

Seems it is a regression.

Deepannagaraj N.

Comment 23 Brad Buckingham 2017-11-14 21:55:11 UTC
Hi Jeff,

It seems that the alternative outlined in comment 3 is no longer working on 6.2.12.  Do you know of any changes that may have caused that behavior to regress?