<?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 Disable Logging inPython `dbutils.fs.put`? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/disable-logging-inpython-dbutils-fs-put/m-p/131823#M49254</link>
    <description>&lt;P&gt;This function logs every time it writes to stdout "Wrote n bytes." I want to disable its logging as I have thousands of files I'm writing and it floods the log with meaningless information. Does anyone know if it's possible?&lt;/P&gt;</description>
    <pubDate>Fri, 12 Sep 2025 21:01:02 GMT</pubDate>
    <dc:creator>ToBeDataDriven</dc:creator>
    <dc:date>2025-09-12T21:01:02Z</dc:date>
    <item>
      <title>Disable Logging inPython `dbutils.fs.put`?</title>
      <link>https://community.databricks.com/t5/data-engineering/disable-logging-inpython-dbutils-fs-put/m-p/131823#M49254</link>
      <description>&lt;P&gt;This function logs every time it writes to stdout "Wrote n bytes." I want to disable its logging as I have thousands of files I'm writing and it floods the log with meaningless information. Does anyone know if it's possible?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Sep 2025 21:01:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/disable-logging-inpython-dbutils-fs-put/m-p/131823#M49254</guid>
      <dc:creator>ToBeDataDriven</dc:creator>
      <dc:date>2025-09-12T21:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Logging inPython `dbutils.fs.put`?</title>
      <link>https://community.databricks.com/t5/data-engineering/disable-logging-inpython-dbutils-fs-put/m-p/131844#M49260</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/184372"&gt;@ToBeDataDriven&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;If it's a notebook cell, you can silence the output of the cell by using &lt;STRONG&gt;%%capture&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%%capture
dbutils.fs.put("dbfs:/FileStore/anudeep/datasets/word_count/tmp/3.txt","foo")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to do it in your code, then there is no flag to silence the output, but you can use a wrapper function in Python as a workaround.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os
from contextlib import redirect_stdout, redirect_stderr
from io import StringIO

def dbutils_put(path: str, contents: str, overwrite: bool = True) -&amp;gt; None:
    sink = StringIO()
    with redirect_stdout(sink), redirect_stderr(sink):
        dbutils.fs.put(path, contents, overwrite)

dbutils_put("dbfs:/FileStore/anudeep/streaming_datasets/word_count/tmp/4.txt","abc")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if this works for you. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2025 08:26:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/disable-logging-inpython-dbutils-fs-put/m-p/131844#M49260</guid>
      <dc:creator>K_Anudeep</dc:creator>
      <dc:date>2025-09-13T08:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Logging inPython `dbutils.fs.put`?</title>
      <link>https://community.databricks.com/t5/data-engineering/disable-logging-inpython-dbutils-fs-put/m-p/131989#M49314</link>
      <description>&lt;P&gt;Thanks for the reply!&lt;/P&gt;&lt;P&gt;Would that code solution be per thread or would it only work on stdout globally?&lt;/P&gt;&lt;P&gt;I basically have a thread pool doing the work, and I need all the output except fs.put. If it disables it globally I may lose output while it's performing the put.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Sep 2025 13:56:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/disable-logging-inpython-dbutils-fs-put/m-p/131989#M49314</guid>
      <dc:creator>ToBeDataDriven</dc:creator>
      <dc:date>2025-09-15T13:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Logging inPython `dbutils.fs.put`?</title>
      <link>https://community.databricks.com/t5/data-engineering/disable-logging-inpython-dbutils-fs-put/m-p/132010#M49326</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/184372"&gt;@ToBeDataDriven&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;STRONG&gt;redirect_stdout&lt;/STRONG&gt; is process-global, not per-thread.&lt;BR /&gt;It temporarily rebinds sys.stdout for the whole interpreter, so in a thread pool, you can accidentally swallow other threads’ prints while the with block is active. It’s not thread-safe for your use case. If you need all the output except fs.put, then you need to isolate it; otherwise, I&lt;SPAN&gt;&amp;nbsp;dont think there is another option.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Sep 2025 15:22:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/disable-logging-inpython-dbutils-fs-put/m-p/132010#M49326</guid>
      <dc:creator>K_Anudeep</dc:creator>
      <dc:date>2025-09-15T15:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Disable Logging inPython `dbutils.fs.put`?</title>
      <link>https://community.databricks.com/t5/data-engineering/disable-logging-inpython-dbutils-fs-put/m-p/132176#M49377</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/184372"&gt;@ToBeDataDriven&lt;/a&gt;&amp;nbsp;, If the above answered your question, then could you please help accept the solution?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Sep 2025 02:54:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/disable-logging-inpython-dbutils-fs-put/m-p/132176#M49377</guid>
      <dc:creator>K_Anudeep</dc:creator>
      <dc:date>2025-09-17T02:54:20Z</dc:date>
    </item>
  </channel>
</rss>

