Mar-15-2025, 08:07 AM
Hello All,
I want to create an .env file which should contains the dictionary format variables for logging. Later I would like to read those variables through my code.
Below is my
How to read the above env file through my code and reading, how to enable it on the fly.
Thanks for your support.
Regards,
Maiya
I want to create an .env file which should contains the dictionary format variables for logging. Later I would like to read those variables through my code.
Below is my
Quote:mymodule.envfile
logging = { 'module1': { 'path': '/usr/log/module1.log', 'level': 'DEBUG' }, 'module2': { 'path': '/usr/log/module2.log', 'level': 'DEBUG' }, 'module3': { 'path': '/usr/log/module3.log', 'level': 'DEBUG' } }And at the same I want this variable to enable and disable on the fly. For example, just by enabling this variable (logging) will be activated and it should start logging.
How to read the above env file through my code and reading, how to enable it on the fly.
Thanks for your support.
Regards,
Maiya