2

How can I reduce the size of my search logs in Sitecore 10.1? Just one search log is currently reaching over 2 GB in size within a few hours, and I've observed that the majority of them are associated with the sitecore_testing_index index. Is there a way to prevent this particular index from generating such large logs?

3608 11:16:20 INFO  Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
29292 11:16:20 INFO  Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
3608 11:16:20 INFO  Solr Query - ?q=host_s:("f7731c3cf31f486aa577155f184766f5en") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
24700 11:16:20 INFO  Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
24700 11:16:20 INFO  Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
29292 11:16:20 INFO  Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
22552 11:16:20 INFO  Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
3608 11:16:20 INFO  Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
38584 11:16:20 INFO  Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
3608 11:16:20 INFO  Solr Query - ?q=host_s:("f7731c3cf31f486aa577155f184766f5en") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
3608 11:16:20 INFO  Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
22552 11:16:20 INFO  Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396ben") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
13688 11:16:20 INFO  Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
38584 11:16:20 INFO  Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
22552 11:16:20 INFO  Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396bzhcn") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
38584 11:16:20 INFO  Solr Query - ?q=host_s:("c0a338a815ee482495912d013cbb396bzhcn") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
20868 11:16:20 INFO  Solr Query - ?q=host_s:("f7731c3cf31f486aa577155f184766f5en") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
38584 11:16:20 INFO  Solr Query - ?q=host_s:("f7731c3cf31f486aa577155f184766f5en") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
13688 11:16:20 INFO  Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
38584 11:16:20 INFO  Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
13688 11:16:20 INFO  Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
29292 11:16:20 INFO  Solr Query - ?q=host_s:("f7731c3cf31f486aa577155f184766f5en") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
3608 11:16:20 INFO  Solr Query - ?q=host_s:("2be2d15a9564458290fd8e3259959cdden") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml
24700 11:16:20 INFO  Solr Query - ?q=host_s:("9294241878304ad78dd0afffc5f8247aen") AND _val_:__boost&start=0&rows=1000000&fl=datasourceitems_s,friendlyowner_s,modeltrainingtaskid_s,_itemuri_s,hosturi_s,device_s,__is_running_b,host_s,parsedowner_s,winnercombination_t,__workflow_state,__smallupdateddate_tdt,_searchtext_s,__smallcreateddate_tdt,_uniqueid,_datasource&fq=_indexname:(sitecore_testing_index)&wt=xml

enter image description here

1 Answer 1

1

I would recommend you change the logging level of the search log. That is all you need to reduce the size of the log file as per your logs details the search log file is mostly filled with Info logs so change it to WARN.

The search log contains information about the search queries that Sitecore executes. It is not specific to sitecore_testing_index index. By default, it sets an Info logging level for the Search log. Therefore you have a lot of info search log details logged into the file.

    <logger name="Sitecore.Diagnostics.Search" additivity="false">
      <level value="INFO" />
      <appender-ref ref="SearchLogFileAppender" />
    </logger>

Try to change the logging level to WARN using the below patch:

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <log4net>
      <logger name="Sitecore.Diagnostics.Search" additivity="false">
        <level>
            <patch:attribute name="value">WARN</patch:attribute>
        </level>
      </logger>
    </log4net>
  </sitecore>
</configuration>

log4net offers the following log levels, in increasing order of priority: ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF.

You can update logging levels as per the above priority order to match your requirement. Also if you need to off the search log then you can use the logging level OFF.

Hope it helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.