Friday, July 1, 2016

Enable solr indexing debug log of WSO2 servers.

Most of the WSO2 products come with the embedded registry which is stored in several types of service artifacts. Each artifact stored as a registry artifacts. Registry artifacts are stored in an underline database as a blob content.
In practical scenario WSO2 products (ESB,Governance Registry, API Manager etc) having millions of registry resources. If WSO2 product want to search specific registry resource, It should search it from the millions of records and it will huge time consuming task and it will affected to the overall product performance.
Registry indexing comes to overcome this problem in WSO2 products. It uses embedded Solr indexing to index all of registry resources.

If anybody wants to verify how the indexing done on WSO2 products, There are indexing components you can enable debug logs. To enable it open,

1. CARBON_HOME/repository/conf/log4j.properties file.

2. Add below lines to log4j.properties file.

 log4j.logger.org.wso2.carbon.registry.indexing.solr.SolrClient=DEBUG
 log4j.logger.org.wso2.carbon.registry.indexing.ResourceSubmitter=DEBUG

3. Start Server. You will see below debug log printed in console while registry resources are indexing. 


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{org.wso2.carbon.core.internal.StartupFinalizerServiceComponent} -  Server           :  WSO2 Governance Registry-5.1.0

[2016-07-01 13:57:14,819]  INFO {org.wso2.carbon.core.internal.StartupFinalizerServiceComponent} -  WSO2 Carbon started in 33 sec

[2016-07-01 13:57:15,077]  INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} -  Mgt Console URL  : https://10.100.1.36:9445/carbon/

[2016-07-01 13:57:15,077]  INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} -  Governance Center Store Default Context : http://10.100.1.36:9765/store

[2016-07-01 13:57:15,078]  INFO {org.wso2.carbon.ui.internal.CarbonUIServiceComponent} -  Governance Center Publisher Default Context : https://10.100.1.36:9445/publisher

[2016-07-01 13:57:25,505] DEBUG {org.wso2.carbon.registry.indexing.ResourceSubmitter} -  Resource Updated: Resource at /_system/governance/repository/components/org.wso2.carbon.all-themes/Default/images/warn.png has been submitted to the Indexing Server

[2016-07-01 13:57:25,507] DEBUG {org.wso2.carbon.registry.indexing.ResourceSubmitter} -  Resource Updated: Resource at /_system/governance/repository/components/org.wso2.carbon.all-themes/Default/images/view.gif has been submitted to the Indexing Server

[2016-07-01 13:57:25,508] DEBUG {org.wso2.carbon.registry.indexing.ResourceSubmitter} -  Resource Updated: Resource at /_system/governance/repository/components/org.wso2.carbon.all-themes/Default/images/trace.png has been submitted to the Indexing Server

[2016-07-01 13:57:25,509] DEBUG {org.wso2.carbon.registry.indexing.ResourceSubmitter} -  Resource Updated: Resource at /_system/governance/repository/components/org.wso2.carbon.all-themes/Default/images/test.gif has been submitted to the Indexing Server