paulmo, can't you take the context you had, and not call it a RequestContext
so LoggingContext?
paulmo
Heh, I can change a name no problem...
asalkeld
but fills a different role
used for logging, not auth
kgriffs
so, I think part of the confusion we have going on is in the naming of SecurityContext()
asalkeld
yeah
kgriffs
i was thinking of context, like the context that is global to a given request or something
paulmo
Forget SecurityContext, forget my code, it does not matter to this conversation.
It is just an exapmle that we can throw away.
asalkeld
what it does is categorize data
kgriffs
this SecurityContext is more like... what i was thinking when I talked about "categories" and "metadata"
so, I mean, it isn't bad
I was just confused
(by the nomenclature)
asalkeld
just call it by what it does
paulmo
If I change the name, everyone is happy with it? *boggle*
Is that the real issue?
kgriffs
paulmo: so the idea is, you construct this Thing that contains everything our log formatter needs in order to categorize, ship to different "sinks", etc.?
asalkeld
paulmo, but not used for auth, just loggin
2 seperate things
kgriffs
I think I get why you called it "Context"
it's sort of the local context for this message
...or something. anyway, naming is less important
paulmo
… because everyone told me that I had to use Oslo Context and that was the name of the class.
kgriffs
huh
kgriffs scratches head
paulmo
I can change the name to anything… it does not matter
asalkeld
paulmo, we all learning what you are doing and how it fits in
kgriffs
so...
paulmo
(RequestContext, so I took the Context part and changed the first name…. but anyways)
kgriffs
I feel like we have two Things
RequestContext - has your tenant id, user, app id, whatever
and then you have Category/Meta/Whatever - that is just specific to this thing that just happened
asalkeld
state/some backtrace info
paulmo
… which would also likely have all of the same data that RequestContext would have and then more
kgriffs
so, each time I log, I want to add more stuff that says "this may be useful for end-users" or "only devops will care about this"
and I can also add a dict or something that contains structured data I can pull out and use for formatting as HTML, loglines, whatever later
paulmo
… or mark the data for something to log appropriately. Just a matter of when/where.
Yep
asalkeld
paulmo we only add to the loggingCategory what isn't in the RequestContext
kgriffs
paulmo: yeah, I think there's just been confusion from lumping context in with the other kinds of data
paulmo
Well that is what I was told to do… so I'm confused.
kgriffs
yes, context is in a sense a subset of all the data you want to send each time you log
one option
IlyaE joined the channel
LOG.error('blah', context=CTX, meta={...})
asalkeld
+1
paulmo
Yep, longer log cals
calls
(which is viable, don't get me wrong)
kgriffs
personally, I still like using thread-local storage so you don't even have to pass in context=BLAH each time
but, that's just my opinion
guys, I really gotta run
gonna be late
paulmo
Local storage got me -2ed
asalkeld
later
paulmo
See ya!
I should go too I guess...
asalkeld
paulmo you feel you have more to work on?
kgriffs
paulmo: too bad. I think that is a problem with OpenStack leaders
paulmo
Nope
kgriffs
not being as open-minded or welcoming of new ideas, but whatever
that is a different topic
(not all leaders are that way, to be sure)
paulmo
I'll worry about it tomorrow I guess...
kgriffs
paulmo: let's talk tomorrow
paulmo
or perhaps just stop beating myself up with this topic and let someone else handle it.
kgriffs: Ok!
kgriffs
I think we have removed a lot of confusion, which will help a lot