I’m new to Binder and need to debug my notebook through mybinder.org. Is there a way to access the notebook logs? By that I mean the logs that look like this when I run Jupyter notebook locally:
[I 18:29:24.542 NotebookApp] Saving file at /notebooks/Test Notebook.ipynb
[I 18:30:01.211 NotebookApp] Saving file at /notebooks/Test Notebook.ipynb
[I 18:31:03.522 NotebookApp] Saving file at /notebooks/Test Notebook.ipynb
[I 18:31:10.006 NotebookApp] Kernel shutdown: 9d372f98-ecae-4074-bf17-54ff53293706
[I 18:31:12.968 NotebookApp] Shutting down on /api/shutdown request.
[I 18:31:12.969 NotebookApp] Shutting down 0 kernels
[I 18:31:12.969 NotebookApp] Shutting down 0 terminals
My kernel keeps dying and I believe an important message is being reported in these log messages. I assume they are written to a file somewhere? I can get to a terminal in the docker image but am not sure where to look.
They are currently not available to end users. This would be a cool feature to have though (and it has been asked for a few times already).
There is a concrete proposal for how to implement it in
A Pull Request to the https://github.com/jupyter/repo2docker repository that implements MIn’s idea from his comment would be great and (I think) suitable as a first contribution. You probably need to know (or want to learn about) how Docker and Docker entrypoints work. Do you want to give it a go?
I was hoping to access the Jupyter Kernel logs, not the Binder build logs, unless if the Kernel logs end up in the same place? My assumption is that the Kernel logs are internal to the docker container but the build logs precede the container. Is that wrong?
In any case, I’ll take a closer look at this and see what I can come up with. I don’t have a lot of experience with Docker but I now realize I need to learn it anyway, so I might as well give it a try.
I should have made that more explicit: the issue is about the builds logs but the particular comment I linked was a “side comment” about making the Jupyter kernel logs available at run time.
Your assumptions about build logs being external and kernel logs internal are correct.