Thread
#prefect-community
    ale

    ale

    1 year ago
    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?
    Dylan

    Dylan

    1 year ago
    Hi @ale,
    You might be able to use a ResourceManager to create a logger and pass it to the relevant tasks at runtime
    ale

    ale

    1 year ago
    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?
    Dylan

    Dylan

    1 year ago
    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
    ale

    ale

    1 year ago
    We want error logs