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

loguru support standout logging with json and csv #2415

Merged
merged 10 commits into from
Jul 1, 2024
Merged

Conversation

zzzming
Copy link
Collaborator

@zzzming zzzming commented Jun 27, 2024

In a container deployment such as ECS and Kubernetes, the log should go to the standard out. The current log also has a leading timestamp, and line breakers. We would like to remove them and keep the log in a single line for any container based deployment.

Any container based deployment can set container_csv, container_json or container in an env variable LANGFLOW_LOG_ENV to override the default logging format.

These are examples of json and csv based logging. The default behaviour of logging format is unchanged.

{"text": "Updating Langfuse instance\n", "record": {"elapsed": {"repr": "0:00:10.331441", "seconds": 10.331441}, "exception": null, "extra": {}, "file": {"name": "langfuse_plugin.py", "path": "/Users/mingluo/git/langflow/src/backend/base/langflow/services/plugins/langfuse_plugin.py"}, "function": "update", "level": {"icon": "🐞", "name": "DEBUG", "no": 10}, "line": 43, "message": "Updating Langfuse instance", "module": "langfuse_plugin", "name": "langflow.services.plugins.langfuse_plugin", "process": {"id": 32615, "name": "SpawnProcess-1"}, "thread": {"id": 4576949760, "name": "MainThread"}, "time": {"repr": "2024-06-27 18:20:34.705351-04:00", "timestamp": 1719526834.705351}}}

2024-06-27 18:19:53.401 DEBUG auth.py 102 get_secret_key Loaded secret key

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 27, 2024
@dosubot dosubot bot added the enhancement New feature or request label Jun 27, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 28, 2024
@nicoloboschi nicoloboschi enabled auto-merge June 28, 2024 07:03
@italojohnny italojohnny disabled auto-merge July 1, 2024 13:55
@italojohnny italojohnny enabled auto-merge July 1, 2024 13:55
@ogabrielluiz ogabrielluiz disabled auto-merge July 1, 2024 16:36
@ogabrielluiz ogabrielluiz merged commit 46f9f8c into dev Jul 1, 2024
4 checks passed
@ogabrielluiz ogabrielluiz deleted the fix/logformat branch July 1, 2024 16:36
ogabrielluiz pushed a commit that referenced this pull request Jul 1, 2024
support standout logging with json and csv

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants