Do not write log files in production systems
Closed this issue · 1 comments
jotauses commented
When used in a production system with the log to an external system such as Sentry or Datadog, I am not interested in writing to a log file because it consumes a lot of hard drive. Can it be removed so that it does not write log files?
Dragon2fly commented
Hi @jotauses
Writing to file is the responsibility of the error_file_handler
.
So to disable writing to log files, you simply remove this handler from the root's handler list.
By using the config file, just remove the "error_file_handler"
:
logger_tt/logger_tt/log_config.json
Line 66 in f188a4c
Or remove it at runtime:
logging.getLogger().removeHandler(logging.getLogger().handlers[1])
Have a good day!