Dragon2fly/logger_tt

Do not write log files in production systems

Closed this issue · 1 comments

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?

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":

"handlers": ["console", "error_file_handler"]

Or remove it at runtime:

logging.getLogger().removeHandler(logging.getLogger().handlers[1])

Have a good day!