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

David Smiley commented on SOLR-12987:
-------------------------------------

First, I want to say that I don't think we should bother logging these 
deprecations to a separate file.  If a user wants to configure log4j2.xml for 
this, they could do so (e.g. via all warnings).  Moreover, there is _already_ 
an easy way to see your warnings (to include deprecations) thanks to the 
logging tab in the Solr admin UI powered by the LoggingHandler and LogWatcher 
(defaulting to WARN level).  Great!

I got started on a trivial deprecation logger and quickly realized what I was 
doing was partially redundant with a cool feature in Solr that already logs 
Deprecated annotations on classes loaded via 
[SolrResourceLoader|https://github.com/apache/lucene-solr/blob/5e617ccc33d91998a992a87ae258de43ef75242e/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java#L532].
  While cool, it's a problem that +there is no way to control the message that 
is reported+, or to prevent logging this.  Here is what's reported for the DIH:
{noformat}
2020-09-28 20:50:27.899 WARN  (coreLoadExecutor-13-thread-2) [   x:mail] 
o.a.s.c.SolrResourceLoader Solr loaded a deprecated plugin/analysis class 
[solr.DataImportHandler]. Please consult documentation how to replace it 
accordingly.
{noformat}

This is a great example of the problem because I'd rather we not log a warning 
about the DIH being deprecated -- it is being _moved_.  The deprecation notion 
is _sometimes_ only useful for those maintaining Solr itself (us committers).  
Maybe we could just remove the annotation and only use the javadoc 
{{\@deprecated}} tag for plugins we know are _moving_?  CC [~ichattopadhyaya]

Also, once we have a DeprecationLog feature (PR forthcoming), SRL could be 
modified to use it so that it logs once.

> Log deprecation warnings to separate log file
> ---------------------------------------------
>
>                 Key: SOLR-12987
>                 URL: https://issues.apache.org/jira/browse/SOLR-12987
>             Project: Solr
>          Issue Type: New Feature
>          Components: logging
>            Reporter: Jan Høydahl
>            Assignee: David Smiley
>            Priority: Major
>
> As discussed in solr-user list:
> {quote}When instructing people in what to do before upgrading to a new 
> version, we often tell them to check for deprecation log messages and fix 
> those before upgrading. Normally you'll see the most important logs as WARN 
> level in the Admin UI log tab just after startup and first use. But I'm 
> wondering if it also makes sense to introduce a separate 
> DeprecationLogger.log(foo) that is configured in log4j2.xml to log to a 
> separate logs/deprecation.log to make it easier to check this from the 
> command line. If the file is non-empty you have work to do :)
> {quote}



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

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

Reply via email to