0

When I start a notebook server, there are some log message shows in the backend(the terminal where the ipython notebook command executed). How could I get the error message in the browser?

E.g. In the backend: (I use python to call some java method)

2015-12-09 22:34:33,483 [Thread-2] ERROR SomeErrorMessage - java.io.FileNotFoundException: File does not exist: hdfs://sample/test.txt

But in the browser, it just failed silently without showing anything and return a None value.

How could I get the message above in the notebook(in browser)?

Thanks

1 Answer 1

0

I found it in this link:Stdout in IPython notebook vs CLI IPython

here is one reason:

When you do os.system, it's not capturing stdout/stderr from the new process. In the terminal, this works, because stdout and stderr just go directly to the terminal, without Python ever knowing about them. In the notebook, it doesn't, because the kernel can only forward stdout/stderr that it knows about.

Another reason is the I misunderstood the error and the log. It has to throw the error for catching other then simply log it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.