-
Notifications
You must be signed in to change notification settings - Fork 13
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
ENH: Use the PsrLogMessageProcessor so that custom factory created loggers can use context. #53
base: 3
Are you sure you want to change the base?
Conversation
Attaching some slack context:
|
I get that, on one hand the point of context is to know what a scope looks like at the particular line that is being logged but on the other hand this isn't surrounded by application logic. It's intent is solely to log so having context inline is ugly when you want to optionally add to it. I'll change the couple I inlined back and extract the rest of them as well on that note. |
…ggers can use context.
dd43efe
to
7da47f3
Compare
Hey @michalkleiner, I've:
All tests are now passing with the singular exception of Noting that I haven't reviewed the diff yet because I'm still not sure how to move forward with that session-manager test, there might be quite a few silly bits'n bobs. I'll revisit this in a few days to clean that up and work on any feedback. So onwards to the rant which is maybe more of something for the CMS team ! -> I think this has been mentioned before in PRs on this module but the way session-manager and mfa are included here is a bit of a pain. Here are a few things I think are already broken (not regressed within this PR):
I'm sort of thinking this more of something for the CMS team to look at, I think the audit hook module integrations belong in their respective modules not here. They use a singular API from silverstripe/auditor (the Injected CC @GuySartorelli any thoughts on how we minimised this API breakage from happening in the future? |
Probably conflicting with lower versions would be the way to do that.
I only briefly glanced at this list but it sounds like some of these are genuine bugs - are there issues for them?
When did the API break? What specific breaks occurred? Other than the one you pointed to a specific commit to - this team was a bit looser about API breaks 2 years ago, so that specific example would be much less likely to happen today. |
Is conflicting something I can work on here or something that would be done across supported modules? If there are examples can you provide one so I can follow it's pattern for this.
Sounds like you want me to split the issues out and that is a good idea, I've started with #54 and will do a few more.
Probably should have been a bit more clear that I was referring to the removeLoginSession API change (public) that caused this module to break, issue for that here: #55 |
Primarily I'm keen to avoid 'sprintf'ing into monolog as it's a bit of an anti-pattern and ruins the the use of the custom factory to some degree since monolog components can't make use of the context.
I think PsrLogMessageProcessor is a perfect change as it should keep the logging format the exact same (coverable by tests, if they exist) and keep the diff down.
Can we use enums in SS code style? I saw the module was ^8.1 but feel a bit unsure about that.