-
Notifications
You must be signed in to change notification settings - Fork 528
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
Update logging configuration for better debug and error tracking #3260
Conversation
ruff.toml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this change in permission (not sure if you meant to commit something else, given the commit subject).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you running ruff through make? If not, what's the version of ruff?
I checked locally with 0.4.7, and I see the same error as the CI
diff --git a/pontoon/settings/base.py b/pontoon/settings/base.py
index 03c629d8..fd419406 100644
--- a/pontoon/settings/base.py
+++ b/pontoon/settings/base.py
@@ -764,14 +764,14 @@ LOGGING = {
},
"django_file": {
"class": "logging.handlers.RotatingFileHandler",
- "filename": os.path.join(path('django_debug.log')),
+ "filename": os.path.join(path("django_debug.log")),
"maxBytes": 1024 * 1024 * 2, # 2 MB
"backupCount": 3,
"formatter": "verbose" if DEBUG else "simple",
},
"pontoon_file": {
"class": "logging.handlers.RotatingFileHandler",
- "filename": os.path.join(path('pontoon_debug.log')),
+ "filename": os.path.join(path("pontoon_debug.log")),
"maxBytes": 1024 * 1024 * 2, # 2 MB
"backupCount": 3,
"formatter": "verbose" if DEBUG else "simple",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No am not running it through make, my ruff version is 0.4.6
e908898
to
e1e4e04
Compare
@flodolo found what the fuss was about and I have fixed it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch! Nice work!
I'd like the logging settings to remain exactly the same as they are ATM.
All the changes (logging to a file, logging format) should be optional and controlled via environment variables.
sure thing I'll update that |
hey @mathjazz , I have updated the PR, sorry for the late update. |
Thanks for the update! Logging is apparently still more verbose than on
Could we split this patch into two pieces? Namely:
|
Sure thing. Sorry about the more verbose logging, I'll remove the more verbose logging and focus on the task at hand |
@mathjazz I have removed the simple, logging option, I have looked at the verbose logging options and I noticed it's currently the same as yours. |
hello @mathjazz am really interested in this project, this PR is taking almost a month now 😅, if you don't mind could you give one of your social platforms you are active in so that we could talk more about how you want me to approach this issue, and hence a smooth workflow for future issues and PRs |
Hey @RafaelJohn9, thanks for your contribution and patience! See the README for contact information (I'm mathjazz on chat.mozilla.org and other channels): As mentioned earlier, #3192 is only about adding the ability to log to a file. There's still a few changes in this PR that are not needed for that. As soon as this is addressed, we can ship this. |
@mathjazz |
I have corrected the changes that you reviewed above. |
Thanks for the update. Functionality looks good, please fix the linting error and we're done! |
done, 👍 |
@RafaelJohn9 Could you please document the newly added environment variable: Sorry I missed that earlier! |
@mathjazz done, lemme know if there is anything else required |
- Added rotating file handlers for Django and Pontoon loggers - Console logging now uses verbose format in DEBUG mode - Improved log formatting for clarity and consistency added *.log in .gitignore to prevent log files from being pushed
… via environment variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the docs. I've pushed a minimal text style change directly.
Nice work with the patch, let's merge!
Fix #3192
Added rotating file handlers for Django and Pontoon loggers
Console logging now uses verbose format in DEBUG mode
Improved log formatting for clarity and consistency
added *.log in .gitignore to prevent log files from being pushed