You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Chris M. Hostetter (Jira)" <ji...@apache.org> on 2021/08/31 21:27:00 UTC

[jira] [Commented] (SOLR-15610) Support json formatted logging via conf: add log4j-layout-template-json to 'server'

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

Chris M. Hostetter commented on SOLR-15610:
-------------------------------------------

The crux of this change would simply be...
{code:java}
 diff --git a/solr/server/build.gradle b/solr/server/build.gradle
index 371c5ce456f..d6df58da7b0 100644
--- a/solr/server/build.gradle
+++ b/solr/server/build.gradle
@@ -72,6 +72,7 @@ dependencies {
   libExt 'org.apache.logging.log4j:log4j-1.2-api'
   libExt 'org.apache.logging.log4j:log4j-api'
   libExt 'org.apache.logging.log4j:log4j-core'
+  libExt 'org.apache.logging.log4j:log4j-layout-template-json'
   libExt 'org.apache.logging.log4j:log4j-slf4j-impl'
   libExt 'org.apache.logging.log4j:log4j-web'
 
{code}
...but with the obvious additions of  {{versions.lock}} and {{solr/licenses/}} files for the new jar.

 

Any objections?

> Support json formatted logging via conf: add log4j-layout-template-json to 'server'
> -----------------------------------------------------------------------------------
>
>                 Key: SOLR-15610
>                 URL: https://issues.apache.org/jira/browse/SOLR-15610
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Chris M. Hostetter
>            Assignee: Chris M. Hostetter
>            Priority: Major
>
> JSON Formatted logging is becoming wide spread enough that it seems like we should support it as an option in Solr.
> Assuming we upgrade to log4j >= 2.14.0  (SOLR-15609) then this becomes _possible_ for people to do by:
>  # downloading the {{log4j-layout-template-json.jar}} that corresponds with the lof4j version used by their solr version
>  # include the {{log4j-layout-template-json.jar}} in the (jetty) classpath via {{SOLR_OPTS}} (can't be loaded as a solr plugin because it needs to be used on startup)
>  # specify their own {{LOG4J_PROPS}} file that configures log4j to use a {{JsonTemplateLayout}}
> ..but steps #1 and #2 are a bit hairy.  Particularly step #1 as it means every time users upgrade solr they have to pay careful attention to if/when the log4j deps change.
> ----
> I would like to propose that we make this easier, by adding {{log4j-layout-template-json}} as a dependency for the "server" module, so that it is available out of the box when running solr – that way JSON logging can be enabled easily with a simple {{LOG4J_PROPS}} change.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org