<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is there a way to capture the notebook logs from ADF pipeline? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34287#M25057</link>
    <description>&lt;P&gt;Hi @Jose Gonzalez​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is working as expected with try .. exception..assert False..&lt;/P&gt;</description>
    <pubDate>Wed, 01 Dec 2021 07:40:53 GMT</pubDate>
    <dc:creator>SailajaB</dc:creator>
    <dc:date>2021-12-01T07:40:53Z</dc:date>
    <item>
      <title>Is there a way to capture the notebook logs from ADF pipeline?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34279#M25049</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to capture notebook custom log exceptions(python) from ADF pipeline based on the exceptions pipeline should got succeed or failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any mechanism to implement it. In my testing ADF pipeline is successful irrespective of the log errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notebook always returns SUCCESS do adf's activity, even exception is raised in notebook.If a notebook contains any exceptions then adf pipeline which contains that particular notebook activity should fail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 08:37:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34279#M25049</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2021-11-29T08:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to capture the notebook logs from ADF pipeline?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34280#M25050</link>
      <description>&lt;P&gt;Hi @Sailaja B​&amp;nbsp; the notebook errors will be tracked in the driver log4j output. You can check the cluster's driver logs to get this information. Or you can set logging to your cluster so that all the messages will be logged in the dbfs or storage path that you provide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer to the document. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/clusters/configure.html#cluster-log-delivery-1" alt="https://docs.databricks.com/clusters/configure.html#cluster-log-delivery-1" target="_blank"&gt;https://docs.databricks.com/clusters/configure.html#cluster-log-delivery-1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 09:20:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34280#M25050</guid>
      <dc:creator>Prabakar</dc:creator>
      <dc:date>2021-11-29T09:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to capture the notebook logs from ADF pipeline?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34281#M25051</link>
      <description>&lt;P&gt;Next to the mentioned option, there is also the possibility to analyze logs using Azure Log Analytics:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/azure/databricks/administration-guide/account-settings/azure-diagnostic-logs" alt="https://docs.microsoft.com/en-us/azure/databricks/administration-guide/account-settings/azure-diagnostic-logs" target="_blank"&gt;https://docs.microsoft.com/en-us/azure/databricks/administration-guide/account-settings/azure-diagnostic-logs&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 09:23:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34281#M25051</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-11-29T09:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to capture the notebook logs from ADF pipeline?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34282#M25052</link>
      <description>&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is not to store/get the log info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My scenario is like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notebook always returns SUCCESS do adf's activity, even exception is raised in notebook.If a notebook contains any exceptions then adf pipeline which contains that particular notebook activity should fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 09:45:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34282#M25052</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2021-11-29T09:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to capture the notebook logs from ADF pipeline?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34283#M25053</link>
      <description>&lt;P&gt;Hi @Sailaja B​&amp;nbsp; notebook/job fails to happen when there is really a failure. Some exceptions are information that might not hurt the running notebook. To understand better, please share the exception that you see in the notebook output.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 10:08:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34283#M25053</guid>
      <dc:creator>Prabakar</dc:creator>
      <dc:date>2021-11-29T10:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to capture the notebook logs from ADF pipeline?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34284#M25054</link>
      <description>&lt;P&gt;Here is the sample code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not any(mount.mountPoint == "/test/" for mount in dbutils.fs.mounts()):&lt;/P&gt;&lt;P&gt;&amp;nbsp;dbutils.fs.mount(source = "***",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mount_point = "/test/",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;extra_configs = configs)&lt;/P&gt;&lt;P&gt;else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;logger.error("Directory is already mounted")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : Mount path is already existed.. If I run this notebook through ADF pipeline, I am expecting that pipeline should fails but it is not getting failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 10:18:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34284#M25054</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2021-11-29T10:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to capture the notebook logs from ADF pipeline?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34285#M25055</link>
      <description>&lt;P&gt;Also when you catch exception you can just save it anywhere even to Databricks Table something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;try:
(...)
except Exception as error:
   spark.sql(f"""INSERT INTO   (...)   """", repr(error))
   dbutils.notebook.exit(str(jobId) + ' - ERROR!!! - ' + repr(error))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In my opinion as @werners said is good choice to send to Azure Log Analytics for detailed analysis but I like also to use also above method and just have nice table in databricks with jobs which failed &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 10:32:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34285#M25055</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2021-11-29T10:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to capture the notebook logs from ADF pipeline?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34286#M25056</link>
      <description>&lt;P&gt;Hi @Sailaja B​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will beed to raise/throw the error exception to stop your Spark execution. Try to use a try..catch statement block handle your custom exceptions.   &lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 18:42:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34286#M25056</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2021-11-29T18:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to capture the notebook logs from ADF pipeline?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34287#M25057</link>
      <description>&lt;P&gt;Hi @Jose Gonzalez​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is working as expected with try .. exception..assert False..&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 07:40:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34287#M25057</guid>
      <dc:creator>SailajaB</dc:creator>
      <dc:date>2021-12-01T07:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to capture the notebook logs from ADF pipeline?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34288#M25058</link>
      <description>&lt;P&gt;Hi SailajaB,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notebook, once executed successfully return a long JSON formatted output. We need to specify appropriate nodes to fetch the output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In below screenshot we can see that when notebook ran it returns empName &amp;amp; empCity as output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2281i8693F81C10988E92/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;To capture this, we need to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In respective pipeline, add a VARIABLE (to capture output of NOTEBOOK Task)&lt;/LI&gt;&lt;LI&gt;Add a SET VARIABLE activity and use VARIABLE defined in above step and add below expression:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;B&gt;&lt;I&gt;                   @activity(''YOUR NOTEBOOK ACTIVITY NAME').output.runOutput.an_object.name.value&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add link between NOTEBOOK ACTIVITY and SET VARIABLE ACTIVITY&lt;/LI&gt;&lt;LI&gt;Run your pipeline and you should see the output captured in this variable&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Note: If you want to specify custom return value then you need to use : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;I&gt;                  dbutils.notebook.exit('VALUE YOU WANT TO RETURN')&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know how it goes.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;GS&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 06:50:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34288#M25058</guid>
      <dc:creator>GurpreetSethi</dc:creator>
      <dc:date>2021-12-22T06:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to capture the notebook logs from ADF pipeline?</title>
      <link>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34289#M25059</link>
      <description>&lt;P&gt;Hi @Sailaja B​&amp;nbsp;Is it working now?I mean, Is pipeline showing failure when notebook failed.If yes please share a sample snippet?(I am also trying the same case .I am able capture logs from pipeline side using output Json but couldn't modify pipeline status)&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 08:36:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/is-there-a-way-to-capture-the-notebook-logs-from-adf-pipeline/m-p/34289#M25059</guid>
      <dc:creator>manasa</dc:creator>
      <dc:date>2022-09-07T08:36:38Z</dc:date>
    </item>
  </channel>
</rss>

