A long time ago, we discussed making it easy to plug in/configure transformers for any message that came through. That would make it easy to log, but it would also make it easy to, for example, inspect messages for large images, strip them out and put them into a database, leaving a link in the message, etc. It would be really nice to have some easy way to configure such things in the notebook server.
Thanks, Jason On Thu, Jul 20, 2017 at 3:20 AM Thomas Kluyver <[email protected]> wrote: > Hi Hussein, > > Please do drop us a note when you've got something working - even if we > decide not to add it as an option in the notebook, it could well be a > useful example for people who want to do similar things. > > Best wishes, > Thomas > > On 20 July 2017 at 02:17, Hussein Elgridly <[email protected]> > wrote: > >> Hi Thomas, >> >> This is great. As you suggest I suspect the best thing for us to do here >> would be to add some logging code in the on_message function you linked. >> Our users are limited to the notebooks UI only so that should be sufficient >> for our needs. >> >> I may resurrect this thread in a couple of months if we continue down >> this path to ask if you'd like a PR once we've got something working. >> >> Thank you so much! >> -Hussein >> >> On 19 July 2017 at 07:44, Thomas Kluyver <[email protected]> wrote: >> >>> Hi Hussein, >>> >>> There isn't a config option for it, but your understanding is correct, >>> and it should be possible to log what is being executed. You can see the >>> messaging protocol description here: >>> https://jupyter-client.readthedocs.io/en/latest/messaging.html >>> >>> The simplest way to do this in some regards is to connect another client >>> to the kernel, which should broadcast each code cell it receives as an >>> execute_input message. However, this depends on the kernel actually doing >>> so, and you'd still need to know when a new kernel was starting up. >>> >>> Perhaps a more robust way would be to insert a bit of extra code into >>> the notebook server. The execute_request message is sent over a websocket >>> by the browser, received by the server, reserialised and sent over ZMQ to >>> the kernel. The code doing that is here: >>> >>> https://github.com/jupyter/notebook/blob/5.0.0/notebook/services/kernels/handlers.py#L278 >>> >>> That assumes that your users only have Jupyter access through the >>> notebook; if they can use other Jupyter frontends, like the Qt console, >>> then we'd need to get the messages out somewhere else. >>> >>> Best wishes, >>> Thomas >>> >>> On 16 July 2017 at 16:51, Hussein Elgridly <[email protected]> >>> wrote: >>> >>>> Hi folks, >>>> >>>> We're standing up a Jupyter (Python right now, will get R later) stack >>>> and everything is going well so far. The wrinkle is that users will be >>>> talking to federal data and our auditors are getting nervous; they want to >>>> know what people are doing. >>>> >>>> If my understanding of the Jupyter architecture is correct, the >>>> notebook server ultimately bundles up the cell contents and sends them to >>>> the backing kernel through 0MQ. Can we hook into this somewhere and write >>>> all such messages to a log? >>>> >>>> If there is a config flag that already does this I am ecstatic; if you >>>> can point me to "make a pull request somewhere around here" that'd work >>>> too. >>>> >>>> Thanks, >>>> -Hussein >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Project Jupyter" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/jupyter/44e0bcc5-fa2c-4d52-8b9d-00f21ba0bb19%40googlegroups.com >>>> <https://groups.google.com/d/msgid/jupyter/44e0bcc5-fa2c-4d52-8b9d-00f21ba0bb19%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "Project Jupyter" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/jupyter/sLKCCBwlKEc/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/jupyter/CAOvn4qhNEra-RG_JA6JPZzR5EcNbcNgRuUjQkNV6MVFY1Y%3DS%2Bg%40mail.gmail.com >>> <https://groups.google.com/d/msgid/jupyter/CAOvn4qhNEra-RG_JA6JPZzR5EcNbcNgRuUjQkNV6MVFY1Y%3DS%2Bg%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Project Jupyter" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jupyter/CAJHWZXPaKReooRnU%3DFGkgTEk4Z5TJ46WMa609WU%3DCeNrPBMGLQ%40mail.gmail.com >> <https://groups.google.com/d/msgid/jupyter/CAJHWZXPaKReooRnU%3DFGkgTEk4Z5TJ46WMa609WU%3DCeNrPBMGLQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "Project Jupyter" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jupyter/CAOvn4qijYgtxSYeDJxWDv7E9VWL7k29H5mH8%2BWnYK%2Bw-Ob8VBA%40mail.gmail.com > <https://groups.google.com/d/msgid/jupyter/CAOvn4qijYgtxSYeDJxWDv7E9VWL7k29H5mH8%2BWnYK%2Bw-Ob8VBA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CAPDWZHz8k2Ltyt9_y7wYtuixMf1%3DzzxRBXVAdHyO0KqAHpqirQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
