[ 
https://issues.apache.org/jira/browse/SOLR-14699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17552628#comment-17552628
 ] 

Jan Høydahl commented on SOLR-14699:
------------------------------------

Thanks for digging in and recognizing the wish for "real" structure. I also saw 
that Log4j2 has this object logging which would fit the bill. With slf4j would 
follow-up. But then, I have no idea what such a Map<String,Object> log message 
payload would look like when using the default text layout. Probably it will 
use jackson to serialize as json or something?
{quote}The problem is that we don't want a hard runtime dependency on Log4j2.
{quote}
I don't how whether it is important for Solr to be logger agnostic anymore - 
for end users? We are an Application now, not a java war coexisting with other 
apps in the same JVM. It is great for committers, but we already have some deps 
on log4j2 wrt Logging API/UI, so perhaps it is time to just say that Solr uses 
Apache Log4j2 as log backend. Full stop.
{quote}I suppose we could have a fallback approach, detecting ClassNotFound, 
and then just emitting JSON if not?
{quote}
IF someone would swap it for logback, they should anyway use a [log4j2-slf4j 
adapter|https://logging.apache.org/log4j/log4j-2.2/log4j-to-slf4j/index.html], 
that would catch any direct use of log4j, and then you'd not get 
ClassNotFound?? But perhaps the structured message would be serialized to a 
string in the process :)

> 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 50m
>  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]

Reply via email to