notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Option to log Terminal and Notebooks

Open Dubrzr opened this issue 8 years ago • 10 comments

Hi,

I need to implement Terminal and Notebook logging.

How I see it:

  1. Add options in jupyter_notebook_config.py such as:

    • log_terminal: bool (weither we log the terminals)
    • log_notebook: bool (weither we log the notebooks)
    • log_terminal_file: Unicode string (if log_terminal is true, specify where to write logs)
    • log_notebook_file: Unicode string (if log_notebook is true, specify where to write logs)
  2. Log messages in "on_message" and "write_message" in https://github.com/jupyter/notebook/blob/master/notebook/terminal/handlers.py

  3. Log messages in "on_message" and "write_message" in https://github.com/jupyter/notebook/blob/master/notebook/services/kernels/handlers.py

I would like to do a Pull/Request for that, could you please tell me if what I suggest is fine. How can I specify new options for jupyter_notebook_config.py?

Thank you, Julien

Dubrzr avatar Oct 24 '18 10:10 Dubrzr

Hi @Dubrzr

Wonderful proposition.

I suggest:

  • log_terminal_file: Unicode string (if not empty, specify where to write logs)
  • log_notebook_file: Unicode string (if not empty, specify where to write logs)

As well as its command line equivalent: jupyter notebook --log-terminal-file=/my/path/file --log-notebook-file=/my/path/file2

parisni avatar Oct 25 '18 19:10 parisni

Hello all !

that would be an awesome feature !

Niradnik avatar Oct 26 '18 08:10 Niradnik

Maybe this could be done with the python logger?

Dubrzr avatar Nov 07 '18 16:11 Dubrzr

I also really need this, how can I help?

aparrot89 avatar Nov 21 '18 11:11 aparrot89

I want it more ! To infinity and beyond.

PunyPony avatar Dec 03 '18 12:12 PunyPony

This is also important for me to enable running Jupyter in a locked down environment.

I've just been digging into the handler to see if this was possible, and came across this issue as well as #2251 and associated PR #2252 which were made last year and seem pretty much the same idea.

Any comments from the maintainers on this? I'm also happy to help out!

woodyza avatar Dec 19 '18 03:12 woodyza

Any update on this please??

Dubrzr avatar Dec 31 '18 09:12 Dubrzr

We'd like to have this too please

If there is a guidance or hint how this can be done, I am willing to do the work

mpermana avatar Feb 28 '19 21:02 mpermana

@minrk @takluyver @Carreau : any update please? How can we contribute on this please?

Dubrzr avatar Mar 01 '19 19:03 Dubrzr

I created a pull request (https://github.com/jupyter/notebook/pull/2252) a couple of years ago with a similar idea. I'm more than happy to update it since I have been maintaining a fork. Having this directly integrated into the codebase would be awesome!

gclen avatar Mar 17 '19 17:03 gclen