Bug 736127 - /var/log/rhn/rhn_server_xmlrpc.log does not log IP addresses , only 0.0.0.0
Summary: /var/log/rhn/rhn_server_xmlrpc.log does not log IP addresses , only 0.0.0.0
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.6
Hardware: All
OS: All
low
low
Target Milestone: ---
Assignee: Marcelo Moreira de Mello
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space16
TreeView+ depends on / blocked
 
Reported: 2011-09-06 18:51 UTC by Marcelo Moreira de Mello
Modified: 2011-12-22 16:50 UTC (History)
2 users (show)

Fixed In Version: spacewalk-backend-1.6.18-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 736130 (view as bug list)
Environment:
Last Closed: 2011-12-22 16:50:04 UTC


Attachments (Terms of Use)
Patch proposed (2.31 KB, patch)
2011-09-09 13:13 UTC, Marcelo Moreira de Mello
no flags Details | Diff

Description Marcelo Moreira de Mello 2011-09-06 18:51:53 UTC
Description of problem:
/var/log/rhn/rhn_server_xmlrpc.log does not log IP addresses


2011/08/30 17:37:49 +13:00 19502 0.0.0.0: xmlrpc/queue.get(1000010000, 2, 'checkins enabled')
2011/08/30 17:37:50 +13:00 19135 0.0.0.0: xmlrpc/registration.update_packages(1000010000, 'packages: 1016')

Version-Release number of selected component (if applicable):
Spacewalk 1.6 nightly build

How reproducible:
100%


Steps to Reproduce:
1. Increase de debug level at /etc/rhn/rhn.conf
  debug = 6
2. Restart services
3. Look the /var/log/rhn/rhn_server_xmlrpc.log
 
Actual results:

/var/log/rhn/rhn_server_xmlrpc.log does not log IP addresses , only 0.0.0.0 

Expected results:

/var/log/rhn/rhn_server_xmlrpc.log shows the IP addresses

Comment 1 Marcelo Moreira de Mello 2011-09-06 18:53:19 UTC
 Working into this.. 

backend/common/rhnLog.py
----------------
152 class rhnLog:
153     def __init__(self, log_file, level):
154         self.level = level
155         self.log_info = "0.0.0.0: "
156         self.file = log_file.......
157         self.pid = os.getpid()
158         self.real = 0........
159         if self.file in ["stderr", "stdout"]:
160             self.fd = getattr(sys, self.file)
161             self.log_info = ""
162             return


226     # Reinitialize req info if req has changed.
227     def set_req(self, req = None):
228         remoteAddr = '0.0.0.0'
229         if req:.
230             if req.headers_in.has_key("X-Forwarded-For"):
231                 remoteAddr = req.headers_in["X-Forwarded-For"]
232             else:
233                 remoteAddr = req.connection.remote_ip
234         self.log_info = "%s: " % (remoteAddr, )

Comment 2 Marcelo Moreira de Mello 2011-09-09 13:13:42 UTC
Created attachment 522328 [details]
Patch proposed

Hello, 

  Patch sent to approval at spacewalk-devel maillist. 

    Mail Thread: 
       https://www.redhat.com/archives/spacewalk-devel/2011-September/msg00012.html

 Cheers, 
mmello

Comment 3 Michael Mráka 2011-09-13 08:04:57 UTC
Applied to spacewalk master as
commit 33f707177bca9cc70a8b413385b428198761770d
    736127 - fixed /var/log/rhn/rhn_server_xmlrpc.log does not log IP addresses
      Before:
        2011/08/30 17:37:49 +13:00 19502 0.0.0.0: xmlrpc/queue.get(1000010000, 2,'checki
        2011/08/30 17:37:50 +13:00 19135 0.0.0.0: xmlrpc/registration.update_packages(10
    
      After:
        2011/09/09 09:52:59 -02:00 11764 10.12.56.89: xmlrpc/registration.update_package
        2011/09/09 09:52:59 -02:00 11764 10.12.56.89: rhnServer/server_solarispatches.di

Comment 4 Milan Zázrivec 2011-12-22 16:50:04 UTC
Spacewalk 1.6 has been released.


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