can i add something to the pyramid logging ? such as session['login_name'] remote-ip ...
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/4a758c61-1f22-460a-bde9-a4e047d8e389%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
can i add something to the pyramid logging ? such as session['login_name'] remote-ip ...
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
def emit(self, record): | |
| request = get_current_request() | |
| record.ip = get_ip(request) | |
| record.user = get_user(request) | |
| super(CustomStreamHandler, self).emit(record) |
can i add something to the pyramid logging ? such as session['login_name'] remote-ip ...
%(asctime)s %(request.session.login_name)s %(request.client_addr)s %(message)s
You might also look at the pyramid-log package. I think it will do what you want.
On 6/1/17 at 12:07 PM, mmer...@gmail.com (Michael Merickel) pronounced:
> On Thu, Jun 1, 2017 at 11:52 AM, Jeff Dairiki <dai...@dairiki.org> wrote:
>
> > You might also look at the pyramid-log
> > <https://pypi.python.org/pypi/pyramid-log> package. I think it will do
> > what you want.
> >
>
> Jeff, this library looks very nice. You should add it to
> https://trypyramid.com/resources-extending-pyramid.html
Please do!
https://github.com/Pylons/trypyramid.com/issues/202
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAM4%2Bx0EyBSPoGy%2BHW7HwLmcSgBfVbKgbXUvz9bOXOwZva3n9FA%40mail.gmail.com.
[formatter_pyramid]
# NB: Here is the interesting part!
class = pyramid_log.Formatter
format = %(asctime)s %(request.method|no request)s %(request.path_qs|)s
%(levelname)-5.5s [%(name)s] %(message)s