Skip to content

Commit

Permalink
Set file logging to false by default
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bhancockio committed Jan 24, 2025
1 parent b391685 commit ab4566a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agentops/log_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ab4566a

Please sign in to comment.