Skip to content

Commit 7219ee8

Browse files
authored
Set file logging to false by default (#661)
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.
1 parent b391685 commit 7219ee8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

agentops/log_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def format(self, record):
4343

4444

4545
ANSI_ESCAPE_PATTERN = re.compile(r"\x1b\[[0-9;]*m")
46-
log_to_file = os.environ.get("AGENTOPS_LOGGING_TO_FILE", "True").lower() == "true"
46+
log_to_file = os.environ.get("AGENTOPS_LOGGING_TO_FILE", "False").lower() == "true"
4747
if log_to_file:
4848
file_handler = logging.FileHandler("agentops.log", mode="w")
4949
file_handler.setLevel(logging.DEBUG)

0 commit comments

Comments
 (0)