[jira] [Commented] (SOLR-11453) Create separate logger for slow requests

2018-05-04 Thread Remko Popma (JIRA)

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

Remko Popma commented on SOLR-11453:


[~elyograg] Thanks for showing the full config. I notice that rollover occurs 
after the log file exceeds 32MB. That seems very small to me. Not sure how much 
logging you expect, but you may end up with a limited number of small log files 
and lose crucial troubleshooting info.

Also, you may be interested in the [custom delete on rollover 
action|https://logging.apache.org/log4j/2.x/manual/appenders.html#CustomDeleteOnRollover]
 that is more powerful than what can be achieved with  
{{}}.

> Create separate logger for slow requests
> 
>
> Key: SOLR-11453
> URL: https://issues.apache.org/jira/browse/SOLR-11453
> Project: Solr
>  Issue Type: Improvement
>  Components: logging
>Affects Versions: 7.0.1
>Reporter: Shawn Heisey
>Assignee: Shawn Heisey
>Priority: Minor
> Attachments: SOLR-11453.patch, SOLR-11453.patch, SOLR-11453.patch
>
>
> There is some desire on the mailing list to create a separate logfile for 
> slow queries.  Currently it is not possible to do this cleanly, because the 
> WARN level used by slow query logging within the SolrCore class is also used 
> for other events that SolrCore can log.  Those messages would be out of place 
> in a slow query log.  They should typically stay in main solr logfile.
> I propose creating a custom logger for slow queries, similar to what has been 
> set up for request logging.  In the SolrCore class, which is 
> org.apache.solr.core.SolrCore, there is a special logger at 
> org.apache.solr.core.SolrCore.Request.  This is not a real class, just a 
> logger which makes it possible to handle those log messages differently than 
> the rest of Solr's logging.  I propose setting up another custom logger 
> within SolrCore which could be org.apache.solr.core.SolrCore.SlowRequest.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Comment Edited] (SOLR-11453) Create separate logger for slow requests

2018-05-04 Thread Remko Popma (JIRA)

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

Remko Popma edited comment on SOLR-11453 at 5/4/18 10:22 PM:
-

It may be easier to discuss here rather than on the log4j mailing list, so here 
is one idea. 

Configure log4j so that a certain named logger is associated with a separate 
appender. In your application code, all logging that needs to end up in the 
"slow requests" log file should be done using the logger with that name. 

{noformat}


  
logs/app.log
logs/app-slow.log
  
  

  


  

  
  

  


  

  

{noformat}
In your application:
{code}
private final static Logger slowRequests = 
LogManager.getLogger("org.apache.solr.core.SolrCore.SlowRequest");
private final static Logger logger = LogManager.getLogger();

...
logger.trace("normal logging");
slowRequests.trace("a slow request just came in");
{code}

With the above configuration, all log messages sent to the {{slowRequests}} 
logger end up in both the log files. If you want to send the slow request log 
messages to the slow log file only, set {{additivity = "false"}} on the slow 
logger. See the 
[manual|https://logging.apache.org/log4j/2.x/manual/configuration.html#Additivity]
 for details.

{noformat}
...
  

...
{noformat}



was (Author: rem...@yahoo.com):
It may be easier to discuss here rather than on the log4j mailing list, so here 
is one idea. 

Configure log4j so that a certain named logger is associated with a separate 
appender. In your application code, all logging that needs to end up in the 
"slow requests" log file should be done using the logger with that name. 

{noformat}


  
logs/app.log
logs/app-slow.log
  
  

  


  

  
  

  


  

  

{noformat}
In your application:
{code}
private final static Logger slowRequests = 
LogManager.getLogger("org.apache.solr.core.SolrCore.SlowRequest");
private final static Logger logger = LogManager.getLogger();

...
logger.trace("normal logging");
slowRequests.trace("a slow request just came in");
{code}

With the above configuration, all log messages sent to the {{slowRequests}} 
logger end up in both the log files. If you want to send the slow request log 
messages to the slow log file only, set {{additivity = "false"}} on the slow 
logger. See the 
[manual|https://logging.apache.org/log4j/2.x/manual/configuration.html#Additivity]
 for details.

{noformat}
...
  

...
{noformat}


> Create separate logger for slow requests
> 
>
> Key: SOLR-11453
> URL: https://issues.apache.org/jira/browse/SOLR-11453
> Project: Solr
>  Issue Type: Improvement
>  Components: logging
>Affects Versions: 7.0.1
>Reporter: Shawn Heisey
>Assignee: Shawn Heisey
>Priority: Minor
> Attachments: SOLR-11453.patch, SOLR-11453.patch, SOLR-11453.patch
>
>
> There is some desire on the mailing list to create a separate logfile for 
> slow queries.  Currently it is not possible to do this cleanly, because the 
> WARN level used by slow query logging within the SolrCore class is also used 
> for other events that SolrCore can log.  Those messages would be out of place 
> in a slow query log.  They should typically stay in main solr logfile.
> I propose creating a custom logger for slow queries, similar to what has been 
> set up for request logging.  In the SolrCore class, which is 
> org.apache.solr.core.SolrCore, there is a special logger at 
> org.apache.solr.core.SolrCore.Request.  This is not a real class, just a 
> logger which makes it possible to handle those log messages differently than 
> the rest of Solr's logging.  I propose setting up another custom logger 
> within SolrCore which could be org.apache.solr.core.SolrCore.SlowRequest.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Comment Edited] (SOLR-11453) Create separate logger for slow requests

2018-05-04 Thread Remko Popma (JIRA)

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

Remko Popma edited comment on SOLR-11453 at 5/4/18 10:20 PM:
-

It may be easier to discuss here rather than on the log4j mailing list, so here 
is one idea. 

Configure log4j so that a certain named logger is associated with a separate 
appender. In your application code, all logging that needs to end up in the 
"slow requests" log file should be done using the logger with that name. 

{noformat}


  
logs/app.log
logs/app-slow.log
  
  

  


  

  
  

  


  

  

{noformat}
In your application:
{code}
private final static Logger slowRequests = 
LogManager.getLogger("org.apache.solr.core.SolrCore.SlowRequest");
private final static Logger logger = LogManager.getLogger();

...
logger.trace("normal logging");
slowRequests.trace("a slow request just came in");
{code}

With the above configuration, all log messages sent to the {{slowRequests}} 
logger end up in both the log files. If you want to send the slow request log 
messages to the slow log file only, set {{additivity = "false"}} on the slow 
logger. See the 
[manual|https://logging.apache.org/log4j/2.x/manual/configuration.html#Additivity]
 for details.

{noformat}
...
  

...
{noformat}



was (Author: rem...@yahoo.com):
It may be easier to discuss here rather than on the log4j mailing list, so here 
is one idea. 

Configure log4j so that a certain named logger is associated with a separate 
appender. In your application code, all logging that needs to end up in the 
"slow requests" log file should be done using the logger with that name. 

{noformat}


  
logs/app.log
logs/app-slow.log
  
  

  


  

  
  

  


  

  

{noformat}
In your application:
{code}
private final static Logger slowRequests = 
LogManager.getLogger("org.apache.solr.core.SolrCore.SlowRequest");
private final static Logger logger = LogManager.getLogger();

...
logger.trace("normal logging");
slowRequests.trace("a slow request just came in");
{code}

With the above configuration, all log messages sent to the {{slowRequests}} 
logger end up in both the log files. If you want to send the slow request log 
messages to the slow log file only, set {{additivity = "false"}} on the slow 
logger. See the 
[manual|https://logging.apache.org/log4j/2.x/manual/configuration.html#Additivity]
 for details.

> Create separate logger for slow requests
> 
>
> Key: SOLR-11453
> URL: https://issues.apache.org/jira/browse/SOLR-11453
> Project: Solr
>  Issue Type: Improvement
>  Components: logging
>Affects Versions: 7.0.1
>Reporter: Shawn Heisey
>Assignee: Shawn Heisey
>Priority: Minor
> Attachments: SOLR-11453.patch, SOLR-11453.patch, SOLR-11453.patch
>
>
> There is some desire on the mailing list to create a separate logfile for 
> slow queries.  Currently it is not possible to do this cleanly, because the 
> WARN level used by slow query logging within the SolrCore class is also used 
> for other events that SolrCore can log.  Those messages would be out of place 
> in a slow query log.  They should typically stay in main solr logfile.
> I propose creating a custom logger for slow queries, similar to what has been 
> set up for request logging.  In the SolrCore class, which is 
> org.apache.solr.core.SolrCore, there is a special logger at 
> org.apache.solr.core.SolrCore.Request.  This is not a real class, just a 
> logger which makes it possible to handle those log messages differently than 
> the rest of Solr's logging.  I propose setting up another custom logger 
> within SolrCore which could be org.apache.solr.core.SolrCore.SlowRequest.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (SOLR-11453) Create separate logger for slow requests

2018-05-04 Thread Remko Popma (JIRA)

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

Remko Popma commented on SOLR-11453:


It may be easier to discuss here rather than on the log4j mailing list, so here 
is one idea. 

Configure log4j so that a certain named logger is associated with a separate 
appender. In your application code, all logging that needs to end up in the 
"slow requests" log file should be done using the logger with that name. 

{noformat}


  
logs/app.log
logs/app-slow.log
  
  

  


  

  
  

  


  

  

{noformat}
In your application:
{code}
private final static Logger slowRequests = 
LogManager.getLogger("org.apache.solr.core.SolrCore.SlowRequest");
private final static Logger logger = LogManager.getLogger();

...
logger.trace("normal logging");
slowRequests.trace("a slow request just came in");
{code}

With the above configuration, all log messages sent to the {{slowRequests}} 
logger end up in both the log files. If you want to send the slow request log 
messages to the slow log file only, set {{additivity = "false"}} on the slow 
logger. See the 
[manual|https://logging.apache.org/log4j/2.x/manual/configuration.html#Additivity]
 for details.

> Create separate logger for slow requests
> 
>
> Key: SOLR-11453
> URL: https://issues.apache.org/jira/browse/SOLR-11453
> Project: Solr
>  Issue Type: Improvement
>  Components: logging
>Affects Versions: 7.0.1
>Reporter: Shawn Heisey
>Assignee: Shawn Heisey
>Priority: Minor
> Attachments: SOLR-11453.patch, SOLR-11453.patch, SOLR-11453.patch
>
>
> There is some desire on the mailing list to create a separate logfile for 
> slow queries.  Currently it is not possible to do this cleanly, because the 
> WARN level used by slow query logging within the SolrCore class is also used 
> for other events that SolrCore can log.  Those messages would be out of place 
> in a slow query log.  They should typically stay in main solr logfile.
> I propose creating a custom logger for slow queries, similar to what has been 
> set up for request logging.  In the SolrCore class, which is 
> org.apache.solr.core.SolrCore, there is a special logger at 
> org.apache.solr.core.SolrCore.Request.  This is not a real class, just a 
> logger which makes it possible to handle those log messages differently than 
> the rest of Solr's logging.  I propose setting up another custom logger 
> within SolrCore which could be org.apache.solr.core.SolrCore.SlowRequest.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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