cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Best practice for logging in Databricks notebooks?

Gim
Contributor

What is the best practice for logging in Databricks notebooks?

I have a bunch of notebooks that run in parallel through a workflow. I would like to keep track of everything that happens such as errors coming from a stream. I would like these logs to be maintained somewhere either in DBFS or in a storage account.

I got the built-in logging module working but you have to manually transfer the log file from a temp folder in file: to dbfs:/FileStore/log_folder/text.log. DBFS throws an error if the log file is directly assigned to its path with the FileHandler.

This basically works for my purposes but what is the actual best practice of doing it in Databricks?

3 REPLIES 3

Debayan
Databricks Employee
Databricks Employee

Configuring verbose audit logs and configuring audit log delivery can be one of the best practises.

https://docs.databricks.com/administration-guide/account-settings/audit-logs.html

Hubert-Dudek
Esteemed Contributor III

Please consider integration of databricks with datadog https://www.datadoghq.com/blog/databricks-monitoring-datadog/

karthik_p
Esteemed Contributor

@Gimwell Young​ AS @Debayan Mukherjee​ mentioned if you configure verbose logging in workspace level, logs will be moved to your storage bucket that you have provided during configuration. from there you can pull logs into any of your licensed log monitoring tool like eg: Splunk etc. also same config can be used to monitor unity catalog logs. as @Hubert Dudek​ mentioned if you configure datadog, you will have graphical view of resources that are being consumed by workspace like no of clusters active, jobs active etc...

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group