You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Nazerke Seidan (Jira)" <ji...@apache.org> on 2022/05/11 14:16:00 UTC
[jira] [Comment Edited] (SOLR-14699) Solr request logs should escape names, values (SolrQueryResponse.getToLogAsString)
[ https://issues.apache.org/jira/browse/SOLR-14699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17534909#comment-17534909 ]
Nazerke Seidan edited comment on SOLR-14699 at 5/11/22 2:15 PM:
----------------------------------------------------------------
I suggest another proposal: json formatted log message.
Currently, we have:
{code:java}
status=0 QTime=23 key=value ...{code}
Suggestion:
{code:java}
{"status":0,"QTime":23,"key":value,...}{code}
So that, whenever we add a new key-value pair(s), we don't have to worry about encoding.
For example, let's say, we have a 50x server error code. If we would like to add an exception message to the log, we could add an entry in the log message:
{code:java}
{"status":503,"QTime":132,"exception":"shard1 is not found",...} {code}
was (Author: nazerke):
I suggest another proposal: json formatted log message.
Currently, we have:
{code:java}
status=0 QTime=23 key=value ...{code}
Suggestion:
{code:java}
{
"status":0,
"QTime":23,
"key":value,
....
}{code}
So that, whenever we add a new key-value pair(s), we don't have to worry about encoding.
For example, let's say, we have a 50x server error code. If we would like to add an exception message to the log, we could add an entry in the log message:
{code:java}
{
"status":503,
"QTime":132,
"exception":"shard1 is not found",
....
} {code}
> 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
>
> {{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: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org