How to configure logging file location for RDP in Python?

I am setting up a new application using python and the RDP library to get snapshot data. Logging output from the RDP library is ignoring my application logger and output is send to the root of my project directory. How can I redirect the logging information to store this in a different directory?

Tagged:

Best Answer

Answers

  • Hi @Merijn

    Sorry for the delay, I was trying to investigate this.

    You are meant to be able to configure this via a json config file - but at the moment it is not working. If you try to change the folder location it fails - only allows changing the filename...

    It would be using the attached file renamed .json.
    I have asked the Dev team to update me when the issue is fixed so I can let you know.


    rdplibconfig.prod.txt

  • Hi @umer.nalla , Thanks for this. Do you have a small example how I would add this json configuration to my code?
  • Hi @VFM

    You can place the above JSON file into the working directory of your Jupyter notebook or python script and the RDP library should detect and act on it.

  • Hi @VFM

    If you need to place the JSON file in a different file/folder, you can use the following workaround:

    import refinitiv.dataplatform as rdp
    config = rdp.configure.config
    test_config = rdp.configure.ext_config_mod.config_from_json(
    "c:\\Refinitiv\\RDP.Python\\my-config.json",
    read_from_file=True,
    )
    config.update(test_config)

    rdp.log._log_file_handler = rdp.log._create_log_file_handler()


  • Thanks Umer, this works fine for us. This way I am able to keep 2 log files - one for the RDP and one for the applicaiton, seperate.