Hello, I've been playing around with trying to ge...
# prefect-community
Hello, I've been playing around with trying to get the flow logs we see in the UI saved onto disk or on S3. Currently I have my set up like this :
Copy code
def api_flow(url):
    # logger = get_run_logger()
    logger = logging.getLogger()

    #set lower level

    #create file handler
    filehdlr = logging.FileHandler('filehandler.txt',mode='w')
    # set level

    # add handler to logger
    fact_json = call_api(url)
    return fact_json
But it only adds local outputs into the .txt file (filehandler.txt shown below):
Copy code
file handler is created to handle log message in the file
we can create many handlers for the logger
Created task run 'call_api-0' for task 'call_api'
Executing 'call_api-0' immediately...
Finished in state Completed()
Finished in state Completed()
Is there a way I can get the exact flow logs (including the timestamps) saved somewhere (either onprem or on S3) like the output shown below from prefect?
Hey Charles, maybe this discourse article may be of use? How to Stream Prefect Logs to a File