79125936

Date: 2024-10-25 13:41:34
Score: 0.5
Natty:
Report link

Following @MRocklin response, I tested with Dask version 2024.9.1. Logging in distributed workers can be set up using WorkerPlugin. This approach ensures that logging is configured for each worker at startup. Here’s an example:

from distributed import WorkerPlugin
import logging

class MyWorkerPlugin(WorkerPlugin):
    def setup(self, worker):
        # Configure logging on each worker
        logging.basicConfig(level=logging.INFO)

# Initialize your Dask client...

worker_plugin = MyWorkerPlugin()
client.register_plugin(worker_plugin)

# Make some computation...

Explanation

In this example:

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @MRocklin
  • Low reputation (0.5):
Posted by: Joseph Pena