Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set file logging to false by default #661

Conversation

bhancockio
Copy link
Contributor

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.

📥 Pull Request

📘 Description
This pull request modifies the default logging behavior of the AgentOps library. The change ensures that logging to a file is disabled by default, preventing the automatic creation of a log file unless the user explicitly sets the AGENTOPS_LOGGING_TO_FILE environment variable to "true". This update is particularly beneficial for users of other OpenSource libraries that integrate with AgentOps, as it removes the need to configure environment variables to prevent unwanted log file creation.

🧪 Testing

  1. Environment Variable Not Set:
  • Verified that no log file is created when the AGENTOPS_LOGGING_TO_FILE environment variable is not set or set to "false".
  1. Environment Variable Set to True:
  • Set the AGENTOPS_LOGGING_TO_FILE environment variable to "true" and confirmed that a log file named agentops.log is created and logs are written to it.
  1. Backward Compatibility:
  • Ensured that existing functionality remains unaffected for users who have already set the AGENTOPS_LOGGING_TO_FILE environment variable to "true".

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.
@teocns
Copy link
Contributor

teocns commented Jan 24, 2025

Thanks!

Not totally sure whether we want to completely disable this, but I do believe we could do better with the log file location...

The conventional idea I have is:

  • ~/.local/share/<app name>/logfile.log for user apps like AgentOps
  • /var/log/<app name>.log for more system/daemon-like processes

Looking forward to your feedback

@teocns teocns self-requested a review January 24, 2025 22:36
@teocns teocns self-assigned this Jan 24, 2025
@teocns teocns added opinion help wanted Extra attention is needed labels Jan 24, 2025
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@areibman
Copy link
Contributor

Really appreciate the fix, thanks @bhancockio !

@areibman areibman merged commit 7219ee8 into AgentOps-AI:main Jan 24, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed opinion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants