Livebook runtime logs?

Does Livebook have a way to create a runtime log file? I’m thinking of a flow where a job evaluates a livebook file in ‘background’ mode with no eyes on it. Lets say a specific livebook runtime encounters some errors and now I would like to see them.

Thinking out loud; I suppose the wrapper job could fetch the livebook code, evaluate, then send any errors to a normal log file. It would be really nice though to see all the errors in line with code cells in the livebook markdown. A livebook log file of some sort would be really cool. Open it like any other livebook file and it displays all the rendered output of a previous runtime.

This is in line with this idea but not sure what came of it.

The Livebook application is separate from the runtime your notebook runs on. Therefore, if you want to log anywhere, you can configure the Logger in your notebook to log wherever you want.

1 Like

Thanks Jose! So a job can parse the livebook markdown, get all the code and evaluate, then send any output errors etc to a normal log file.

I’m wondering though if there is a way to stitch any runtime errors back to the markdown file for each relevant code cell. This would basically make a pretty markdown log that could be loaded/displayed in livebook.

Oh, I understand it better now.

The issue in implementing what you have in mind right now is that there is no official way for executing a notebook programatically. We want to add APIs for deployed notebooks though. Then you could pass a log file as parameter to the notebook itself :slight_smile:


Makes sense, these would be great feature additions then!

  • background livebook runner i.e. run a livebook like a script
  • save all rendered output / code evaluation / error logs etc to a cloned livemd file called ‘{livebook name}-log-{timestamp}.livemd’
  • the new livemd file can be loaded into livebook app at later time to view how that runtime went

Livebook to me feels like a higher functioning iex session; perfect blend of gui + code. Imo this would take it to next level!