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

Logging system refactor #412

Merged
merged 6 commits into from
Sep 23, 2022
Merged

Logging system refactor #412

merged 6 commits into from
Sep 23, 2022

Conversation

Half-Shot
Copy link
Contributor

@Half-Shot Half-Shot commented Jun 8, 2022

Split out from #410

Our current logging system is hard to use, and also difficult to override. As such we've ended up building our own solutions in the Discord bridges, IRC bridge and the hookshot bridge. This PR attempts to pull in the hookshot way of doing logging into this bridge without trying to break the API entirely.

I've retained our existing log rotation transport feature, but I'm not wholly convinced it's something we want long term. Log rotation is best left to other services (KISS principle applies).

For reference https://github.com/matrix-org/matrix-hookshot/blob/main/src/LogWrapper.ts


The PR rotted enough that trying to merge some changes in broke the world, so I have restarted again on a single PR.

@turt2live
Copy link
Member

(in case it was missed: the bot-sdk has a LogService which it uses internally and can be used externally too)

@Half-Shot
Copy link
Contributor Author

(in case it was missed: the bot-sdk has a LogService which it uses internally and can be used externally too)

Yep, the current problem is that it lacks the ability to set freeform metadata on the Logging object which is something we're going to end up needing for the Request logging we have planned. Given the time-to-merge delays on matrix-bot-sdk, it's not something we're going to be able to depend on easily, hence running out own solution. We still wrap the bot-sdk logger so that the logs get piped nicely into one place.

@Half-Shot Half-Shot marked this pull request as ready for review June 8, 2022 10:53
@Half-Shot Half-Shot requested a review from a team as a code owner September 14, 2022 13:44
src/components/logging.ts Outdated Show resolved Hide resolved
src/components/logging.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@jaller94 jaller94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but the fileName as Object key should get resolved before we merge it.

@Half-Shot Half-Shot requested a review from jaller94 September 22, 2022 12:41
Copy link
Contributor

@jaller94 jaller94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants