I'm trying to get weights and biases logs to appea...
# ask-community
a
I'm trying to get weights and biases logs to appear in my prefect ui logs. I've set
PREFECT_LOGGING_EXTRA_LOGGERS: wandb
in the prefect settings, but nothing has changed. Are there any other steps I need to take?
pls can i get some guidance with this?
@Marvin I'm trying to get weights and biases logs to appear in my prefect ui logs. I've set
PREFECT_LOGGING_EXTRA_LOGGERS: wandb
in the prefect settings, but nothing has changed. Are there any other steps I need to take?
m
It appears you're on the right track with configuring
PREFECT_LOGGING_EXTRA_LOGGERS
, but let's make sure you're doing everything correctly. To include logs from libraries such as Weights and Biases (
wandb
), you need to set
PREFECT_LOGGING_EXTRA_LOGGERS
in your Prefect configuration. From the docs, it should look something like this:
Copy code
PREFECT_LOGGING_EXTRA_LOGGERS: wandb
However, you also need to ensure that your
wandb
logger is correctly configured to propagate logs. Here is a step-by-step guide: 1. Set the Environment Variable: Set
PREFECT_LOGGING_EXTRA_LOGGERS
in your environment.
Copy code
sh
   export PREFECT_LOGGING_EXTRA_LOGGERS=wandb
2. Configure the WandB Logger: Ensure that the
wandb
logger is configured to propagate logs by adding the following to your logging configuration:
Copy code
python
   import logging

   # Retrieve the WandB logger
   wandb_logger = logging.getLogger('wandb')

   # Set the log level (if needed)
   wandb_logger.setLevel(<http://logging.INFO|logging.INFO>)

   # Ensure propagation is enabled
   wandb_logger.propagate = True
3. Run Your Prefect Flow: Execute your Prefect flow and check the UI for logs from
wandb
. If you still don't see the
wandb
logs in your Prefect UI, you might need to further debug both your Prefect and WandB logging configurations. For more detailed steps from the official documentation, you can refer to the Prefect logging guide: Prefect Logging Guide. If these steps don't resolve the issue, consider looking into specific debug logs or opening an issue with detailed information on the Prefect repository. Good luck, and feel free to ask if you need further assistance!