Java 如何在solrj中记录完整的URL?

Java 如何在solrj中记录完整的URL?,java,spring,maven,solr,solrj,Java,Spring,Maven,Solr,Solrj,我有一个Java应用程序,它使用Solrj访问远程solr服务器。它是用Maven和Spring构建的。它的设置如下 实例化solr服务器对象并将其连接到AutoCompleteSolrTemplatebean(自定义): 公共类AutocompleteSolrTemplate扩展了SolrTemplate{ 私有静态最终记录器log=Logger.getLogger(AutocompleteSolrTemplate.class); 公共自动完成SolrTemplate(最终SolrServe

我有一个Java应用程序,它使用Solrj访问远程solr服务器。它是用Maven和Spring构建的。它的设置如下

实例化solr服务器对象并将其连接到AutoCompleteSolrTemplatebean(自定义):


公共类AutocompleteSolrTemplate扩展了SolrTemplate{
私有静态最终记录器log=Logger.getLogger(AutocompleteSolrTemplate.class);
公共自动完成SolrTemplate(最终SolrServer SolrServer,最终字符串核心){
超级(solrServer,核心);
}
最终查询响应runSolrQuery(最终SolrQuery SolrQuery){
返回执行(新的SolrCallback(){
@凌驾
公共QueryResponse doInSolr(最终SolrServer SolrServer)抛出SolrServerException,IOException{
log.debug(“Solr请求:\n\t”+RequestUtil.URLDecode(solrQuery.toString());
返回solrServer.query(solrQuery,METHOD.POST);
}
});
}
}
因此,我可以像上面那样轻松地记录solr请求,但是如何记录完整的solr URL呢?主机是在应用程序加载${solr.host}时被替换的属性,但是出于调试目的,最好记录包括主机在内的完整URL


有什么帮助吗?

您正在创建的
自动完成solrtemplate
如下:

<bean id="customSolrTemplateEncounter" class="com.domain.common.solr.AutocompleteSolrTemplate">
    <constructor-arg ref="solrServer"/>
    <constructor-arg value="encounterAutocomplete"/>
</bean>
<bean id="customSolrTemplateEncounter" class="com.domain.common.solr.AutocompleteSolrTemplate">
    <constructor-arg ref="solrServer"/>
    <constructor-arg value="encounterAutocomplete"/>
</bean>
 public AutocompleteSolrTemplate(final SolrServer solrServer, final String core, final String solrUrl) {
        //Log the URL here!!
        super(solrServer, core);
    }