[
https://issues.apache.org/jira/browse/SOLR-14699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17551757#comment-17551757
]
David Smiley commented on SOLR-14699:
-------------------------------------
I think JsonTemplateLayout is a distraction to what this JIRA issue is about,
and I definitely don't recommend _abusing_ MDC for non-MDC things. I'll repeat
what I wrote above:
bq. Jan: JsonTemplateLayout is generic; it doesn't know that some messages
might in fact be JSON themselves (as this issue proposes). Nazerke and I have a
custom variant of that for "at work" where it's aware of the format of certain
messages and so we get more interesting JSON for these log records. It'd be
interesting if JsonTemplateLayout could support that.
I could see us/Salesforce open-sourcing our custom Json Layout which solves the
need specified by Jan. Nazerke wrote it with heavy guidance/review/input from
me and [~matmarie]. At present I think it's generic (not specific to our
needs) but it's been unclear if/when it might need to be. One quirk of this is
a classpath issue: the class can't be in solr-core; it needs to be at the Jetty
(container) level. So contributing it would mean another module which is kind
of annoying for something trivial. Maybe there's some Jetty jujitsu option to
carve out an exception for some classes, or maybe we dispense with class loader
separation between Solr and Jetty.
> Solr request logs should escape names, values
> (SolrQueryResponse.getToLogAsString)
> ----------------------------------------------------------------------------------
>
> Key: SOLR-14699
> URL: https://issues.apache.org/jira/browse/SOLR-14699
> Project: Solr
> Issue Type: Improvement
> Components: logging
> Reporter: David Smiley
> Priority: Minor
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> {{SolrQueryResponse.getToLogAsString}} encodes the NamedList into a String
> with simple space-separated pairs with name=value. However, it does no
> escaping/encoding, and as-such a value might itself contain spaces and
> equals. This is a problem if these logs are being parsed, and we'd like to
> ensure we do so correctly. Note that SolrLogPostTool (aka "postlogs") parses
> these logs.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]