-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add messageJson resolver, for use with StringMapMessage and its ilk #15
Conversation
Hey @mkedwards. Thanks so much for the patch! Actually, the idea of handling messages is a brilliant idea. Though I do have a few concerns:
I will try to address these issues (hopefully) sometime this week. |
I think Thanks for the heads-up about the ObjectMapper; will do. |
* This means we don't have to use exceptions for control flow in #resolve
@vy I think the commits I just added should address your concerns. I removed the additional ObjectMapper, and changed the exception handling to an |
@mkedwards, @emschwar, why don't we handle JSON emitting |
Looks pretty good to me! I can think of ways to micro-optimize this but I'm not going to worry about that until I've got some better benchmarks for the use cases I'm concerned about, in which we're trying to be selective about which events we log, and avoid expensive operations (using log4j2 lambda-wrapped values and similar trickery) when we're not logging. (And memoize them when we are, in case of multiple appenders.) |
@vy, we've tested your version with our local We think we're going to be able to open-source our message class fairly soon, at which point it might be interesting to explore alternate layout/message interfaces that reduce serialization overhead. Maybe something along the lines of a visitor pattern, where the Layout passes a visitor to the Message and the Message does the tree-walk? Some people refer to that as a SAX-style API, and Jackson's "Streaming API" (JsonGenerator, https://fasterxml.github.io/jackson-core/javadoc/2.9/com/fasterxml/jackson/core/JsonGenerator.html) works that way. Have you worked at all with log4j2 upstream? It seems like this system would benefit from some hard-core perfomance work, which generally involves some API refactoring. If we could get a team together, it would be satisfying to build a "fish tagging" system for Java distributed architectures, comparable to what I've helped build previously in a Javascript/Python/C++ world. (That system resembled log4j2's ContextDataInjector scheme, with the local context transferred as metadata on RESTful API requests and auto-captured by task closures for delegation across thread boundaries.) Netty-based services really need such a thing. |
Issue is fixed in |
No description provided.