[ 
https://issues.apache.org/jira/browse/SOLR-9534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-9534:
------------------------------
    Attachment: SOLR-9534.patch

Attaching patch:

* We support the new environment variable {{SOLR_LOG_LEVEL}} which may be set 
either in {{solr.in.cmd|sh}} or in the shell. If the start scripts finds a 
value for {{SOLR_LOG_LEVEL}} it will pass it on to Solr as option 
{{-Dsolr.log.level=$SOLR_LOG_LEVEL}}
* In {{SolrDispatchFilter.init()}} we check the option, and change the 
rootLogger level programmatically
* Adds two new arguments to {{bin/solr\[.cmd\]}}: {{-v}} and {{-q}} which sets 
{{SOLR_LOG_LEVEL}} to {{DEBUG}} and {{WARN}} respectively. These will override 
whatever set in the environment.

So now you don't need to understand Log4J or dig to find the correct log config 
to make Solr verbose or quiet.

Only Linux script tested. Would be grateful if someone would take {{solr.cmd}} 
for a ride. I do not validate the env.var, but a single-word invalid level will 
simply select the default which is INFO.


> Support quiet/verbose bin/solr options for changing log level
> -------------------------------------------------------------
>
>                 Key: SOLR-9534
>                 URL: https://issues.apache.org/jira/browse/SOLR-9534
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: scripts and tools
>    Affects Versions: 6.2
>            Reporter: Jan Høydahl
>             Fix For: 6.3, master (7.0)
>
>         Attachments: SOLR-9534.patch
>
>
> Spinoff from SOLR-6677
> Let's make it much easier to "turn on debug" by supporting a {{bin/solr start 
> -V}} verbose option, and likewise a {{bin/solr start -q}} for quiet operation.
> These would simply be convenience options for changing the RootLogger from 
> level INFO to DEBUG or WARN respectively. This can be done programmatically 
> in log4j at startup. 
> Could be we need to add some more package specific defaults in 
> log4j.properties to get the right mix of logs



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to