https://prefect.io logo
a

ale

10/22/2020, 5:59 PM
Hi folks, I'd want to configure logging for Rollbar. The issues is that the Rollbar auth token is available only at runtime in an environment variable. I was able to get the token using EnvVarSecret, which is then used to call rollbar.init(), but then I got stuck. How should I add the rollbar logger to prefect logging?
d

Dylan

10/22/2020, 8:20 PM
Hi @ale,
You might be able to use a ResourceManager to create a logger and pass it to the relevant tasks at runtime
a

ale

10/22/2020, 8:50 PM
Hi @Dylan, thanks for the suggestion. I will definitely take a look at resource managers. To give a little more context: we would like to send to Rollbar all errors/warning logs generated in a Prefect flow. That's why we're trying to add an handler to prefect logger. Would resource managers help in this?
d

Dylan

10/22/2020, 8:51 PM
You could pass a created logger to all of your tasks after initializing it at runtime
Do you want error logs or error states?
If you want states you might try a state handler
I’m not sure if we support sending only error/warning logs generated by prefect somewhere
a

ale

10/22/2020, 9:09 PM
We want error logs