From ab4566a7a3736d0e933a0b8ed03506544e519b88 Mon Sep 17 00:00:00 2001 From: Brandon Hancock Date: Fri, 24 Jan 2025 16:00:55 -0500 Subject: [PATCH] Set file logging to false by default This change updates the default behavior of the AgentOps logging configuration to not log to a file unless explicitly specified. Previously, users of other OpenSource libraries that integrate with AgentOps had to set the AGENTOPS_LOGGING_TO_FILE environment variable to avoid creating a log file by default. With this update, the log file will not be created unless the user sets AGENTOPS_LOGGING_TO_FILE to "true". This allows users to opt-in to local file logging if they wish to see their logs locally, rather than just on the AgentOps platform. --- agentops/log_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agentops/log_config.py b/agentops/log_config.py index e578a4358..584cfb381 100644 --- a/agentops/log_config.py +++ b/agentops/log_config.py @@ -43,7 +43,7 @@ def format(self, record): ANSI_ESCAPE_PATTERN = re.compile(r"\x1b\[[0-9;]*m") -log_to_file = os.environ.get("AGENTOPS_LOGGING_TO_FILE", "True").lower() == "true" +log_to_file = os.environ.get("AGENTOPS_LOGGING_TO_FILE", "False").lower() == "true" if log_to_file: file_handler = logging.FileHandler("agentops.log", mode="w") file_handler.setLevel(logging.DEBUG)