Logging#140
Conversation
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| path: cutepets.log | ||
| retention-days: 10 |
There was a problem hiding this comment.
do we just want to keep each log for 10 days?
There was a problem hiding this comment.
This is a good point, I think I would set the prod and dev ones separately. The max length for a public repo is 90 days and none of these are particularly big so we could definitely bump it up a bit. I think maybe 14 days for dev and 30 or 60 for prod.
Also they can be downloaded as long as they haven't expired so we should probably try to download them in cases where we aren't going to get to the issue immediately. Although I should probably give them names that identify which run they come from.
| retention-days: 14 | ||
| archive: false | ||
|
|
||
| - name: Upload API Log artifact |
There was a problem hiding this comment.
should we distinguish between prod and dev logs, or they are automatically distinguished?
There was a problem hiding this comment.
The logs are per run so they only show up in the action that they are logging. We could change the settings of what gets logged according to what action is running them if we wanted though.
patrickZWY
left a comment
There was a problem hiding this comment.
had some questions about what would the logs actually look like, but we should just see it work in production lol
You can see an example here https://github.com/codeforboston/CutePetsBoston/actions/runs/28486266324?pr=140 |
Summary
Adds a logger to the project and uploads the output as an artifact. Currently logs the API response from Rescue Groups for easier debugging.
Adding Logging
To add logging to a different module add the following:
To log something use
logger.debug("string")orlogger.info("string")