In case of Solr index maintenance errors or executions, the following guideline will help you to collect important log information from Solr maintenance operations logged in ICM AS and Solr Cloud server logs.
This article mainly focuses on the custom appender which collects Solr index related database statements, classes, pipelines, and pipelet execution from search index maintenance operation triggered by a scheduled job or back office GUI interaction.
To set up the special logging, you need to perform the following steps. As a result of this, SolrAdapter.log is written in \eserver\share\system\log for further analysis.
The log appender generates dedicated log output from Solr index maintenance operation or index queries.
You only need to adjust the index name mentioned in your Intershop Commerce Management, because it can be specific.
In the following example, the log appender will collect index maintenance information from the ICM back office search index called "product-search-idx-en_US".
As a result, the provided Solr log appender is able to log runtimes from pipelines, pipelets, or database statements you may need for (performance) analysis.
<?xml version="1.0" encoding="UTF-8" ?> <included> <appender name="SolrServer" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> <level>TRACE</level> </filter> <File>${intershop.logfile.Directory}/SolrServer-${intershop.logfile.NamePostfix}.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>${intershop.logfile.Directory}/SolrServer-${intershop.logfile.NamePostfix}-%d{yyyy-MM-dd}.log.zip</FileNamePattern> </rollingPolicy> <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern> [%date{yyyy-MM-dd HH:mm:ss.SSS Z}] [%thread] [Job:%mdc{job.name}] [Req:%mdc{request.uuid}] %-5level %logger %marker - %msg %ex%n </Pattern> </layout> </encoder> </appender> <logger name="org.apache.solr"> <level value="INFO" /> <appender-ref ref="SolrServer" /> </logger> <appender name="SolrAdapter" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> <level>TRACE</level> </filter> <filter name="JobContextFilter" class="ch.qos.logback.core.filter.EvaluatorFilter"> <evaluator name="JobOnly"> <expression> (mdc.containsKey("job")) && (mdc.containsKey("containsKey") || "Cleanup Search Indexes".equals(mdc.get("job.name")) || "Rebuild Search Indexes".equals(mdc.get("job.name")) || "Update Search Indexes".equals(mdc.get("job.name")) || "SearchIndexGenerationproduct-search-idx-en_US".equals(mdc.get("job.name")) || "SearchIndexGenerationproduct-search-idx-de_DE".equals(mdc.get("job.name")) ) || logger.startsWith("com.intershop.adapter.search_solr.internal") </expression> </evaluator> <OnMatch>NEUTRAL</OnMatch> <OnMismatch>DENY</OnMismatch> </filter> <File>${intershop.logfile.Directory}/SolrAdapter-${intershop.logfile.NamePostfix}.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>${intershop.logfile.Directory}/SolrAdapter-${intershop.logfile.NamePostfix}-%d{yyyy-MM-dd}.log.zip</FileNamePattern> </rollingPolicy> <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern> [%date{yyyy-MM-dd HH:mm:ss.SSS Z}] [%thread] [Job:%mdc{job.name}] [Req:%mdc{request.uuid}] %-5level %logger %marker - %msg %ex%n </Pattern> </layout> </encoder> </appender> <logger name="com.intershop.component.search.internal"> <level value="DEBUG" /> <appender-ref ref="SolrAdapter" /> </logger> <logger name="com.intershop.adapter.search_solr"> <level value="DEBUG" /> <appender-ref ref="SolrAdapter" /> </logger> <logger name="com.intershop.beehive.core.internal.performance"> <level value="TRACE" /> <appender-ref ref="SolrAdapter" /> </logger> <logger name="com.intershop.beehive.orm.oracle.internal.query"> <level value="DEBUG" /> <appender-ref ref="SolrAdapter" /> </logger> <logger name="com.intershop.beehive.orm.mssql.internal.query"> <level value="DEBUG" /> <appender-ref ref="SolrAdapter" /> </logger> </included>