0

I want to keep program's logs on logs.log file. I have logging.ini file that keeps the config of logging.

[logging]
logging=false

[loggers]
keys=root

[handlers]
keys=consoleHandler

[formatters]
keys=simpleFormatter

[logger_root]
level=DEBUG
handlers=consoleHandler



[handler_consoleHandler]
class=StreamHandler
level=DEBUG
formatter=simpleFormatter
args=(sys.stdout,)

[formatter_simpleFormatter]
format=%(asctime)s - %(levelname)s - %(message)s
datefmt=%m/%d/%Y %I:%M:%S %p

I want to change if logging=true ;

class = FileHandler
args=('logs.log',)

How can i do that ? Thanks,

Sevval Kahraman
  • 1,185
  • 3
  • 10
  • 37
  • your question is not very clear, so maybe the following two questions will help. [1](https://stackoverflow.com/questions/34437693/how-to-write-an-ini-file-with-if-conditions), [2](https://stackoverflow.com/questions/33418741/modifying-python-variables-based-on-config-file-entries) – A D Jan 07 '22 at 10:48
  • i want to read ini files class and arg keys according to logging value – Sevval Kahraman Jan 07 '22 at 11:11

0 Answers0