Hi all

any idea about the following which whould also
affect the zope.pipeline or the zope.publisher refactoring?

I need some advice for the access log topic in wsgi.

The zope http server logs access in zope.publisher.http

def setPrincipal(self, principal):
    'See IPublicationRequest'
    super(HTTPRequest, self).setPrincipal(principal)
    logging_info = ILoggingInfo(principal, None)
    if logging_info is None:
        message = '-'
        message = logging_info.getLogMessage()
    self.response.authUser = message

This means there is a ILoggingInfo adapter which returns
a simple string. ASCII and no space are preffered because
the standard access log format uses space aas delimiter.
And access lgo fiels are not unicode.

Of corse the ILoggingInfo adapter is responsible for 
choose the right format for each project. A default
is configured in zope.publisher.principallogging

Now to the question.

In the latest checkins there was a access log part
implemented. It doesn't use the ILoggingInfo adapter and
is exposing the user login which is a part of the security
credential. This get already released. (not good)

Is there a standard how WSGI apps will log user info in
access logs? I guess not, right?

Does someone have a good idea how we should implement
user access info for access logs in zope.app.wasg?

If not, I propose the following:

logging_info = ILoggingInfo(request.principal, None)
if logging_info is None:
    message = '-'
    message = logging_info.getLogMessage()
environ['wsgi.logging_info'] = message

- this will set a ``wsgi.logging_info``  environ
  variable (or is there already a standard name)?

- it uses the ILoggingInfo adapter which let us use
  different kind of access log info strategies in 
  custom projects. By default we should use the 
  PrincipalLogging adapter form zope.publisher.principallogging.

Does anybody have a better idea how we can make the user
info available for the access log?

Alex whould this fit for you?

Roger Ineichen

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to