Apache Solr Client =如何启用“wire”日志记录(使用log4j)(Apache Solr Client = How to enable “wire” logging (with log4j))
如果有人能告诉我,如何启用“连线日志记录”(打印所有从solr-java-client发送和接收到的solr-server的XML),我会非常感激。
我使用的客户端: http : //wiki.apache.org/solr/SolJava我使用log4j!
两者都不能在log4j config中工作:
<logger name="org.apache.solr" additivity="false"> <level value="debug" /> <appender-ref ref="RollingFileAppender" /> <appender-ref ref="ConsoleAppender" /> </logger> <logger name="org.apache.commons.httpclient" additivity="false"> <level value="debug" /> <appender-ref ref="RollingFileAppender" /> <appender-ref ref="ConsoleAppender" /> </logger>
Solr内部使用另一个日志框架slf? ,也许这就是原因,但我不知道从这里开始如何解决问题。
谢谢!!! 延
I would be very thankfull, if someone can tell me, how to enable "wire logging" (printing all the XML that is sent and received from the solr-java-client to/from the solr-server).
The Client i use: http://wiki.apache.org/solr/SolJava I use log4j!!
Both did NOT work in log4j config:
<logger name="org.apache.solr" additivity="false"> <level value="debug" /> <appender-ref ref="RollingFileAppender" /> <appender-ref ref="ConsoleAppender" /> </logger> <logger name="org.apache.commons.httpclient" additivity="false"> <level value="debug" /> <appender-ref ref="RollingFileAppender" /> <appender-ref ref="ConsoleAppender" /> </logger>
Solr internally uses another logging framework slf??? ,maybe this is the reason, but I do not know where to start here how to solve the problem.
Thanks!!! Jens
原文:https://stackoverflow.com/questions/6242576
最满意答案
如果您需要将数据保存到服务器,那么您将需要服务器端工具ASP.NET或PHP,正如您所说。
但是,您说您希望以XML格式存储数据,以便以后可以在表单中使用它 。 您可以稍后在同一页面中使用这些数据,并将其放入XML中,如下所示:
interval=setInterval(function(){ first=$('[name*="FirstName"]').val(); last=$('[name*="LastName"]').val(); output='<data><first>'+first+'</first><last>'+last+'</last></data>'; $('#output').text(output); },200);
但我想不出你为什么要这样做的任何理由! 您可以使用纯JavaScript或JQuery直接访问值:
JQuery的:
firstName=$('[name*="FirstName"]').val(); lastName=$('[name*="LastName"]').val();
JS:
firstName=document.form.FirstName.value; lastName=document.form.LastName.value;
If you need to save the data to your server, then you will need server-side tools ASP.NET or PHP, as you say.
However, you said you wanted to store the data in XML format so that you can use it later in the form. You can use the data later in the same page and put it into XML like this:
interval=setInterval(function(){ first=$('[name*="FirstName"]').val(); last=$('[name*="LastName"]').val(); output='<data><first>'+first+'</first><last>'+last+'</last></data>'; $('#output').text(output); },200);
But I can't think of any reason why you would want to do that! You can use plain JavaScript or JQuery to access the values directly:
JQuery:
firstName=$('[name*="FirstName"]').val(); lastName=$('[name*="LastName"]').val();
JS:
firstName=document.form.FirstName.value; lastName=document.form.LastName.value;
相关问答
更多-
如何使用Javascript将表单输入数据保存到XML文件?(How to save form input data to a XML file using Javascript?)[2023-10-09]
如果您需要将数据保存到服务器,那么您将需要服务器端工具ASP.NET或PHP,正如您所说。 但是,您说您希望以XML格式存储数据,以便以后可以在表单中使用它 。 您可以稍后在同一页面中使用这些数据,并将其放入XML中,如下所示: interval=setInterval(function(){ first=$('[name*="FirstName"]').val(); last=$('[name*="LastName"]').val(); output='' ... -
您问是否可以在客户端创建XML 100%? 是。 您无法将其下载为文件(由于安全性),但您可以将其放在文本区域中。 您可以通过在客户端连接字符串来创建xml。 这篇文章展示了如何在客户端使用不同的javascript技术处理XML : 使用JavaScript在内存中生成XML文档 Jquery: 如何使用jQuery解析XML? aaaand这里有一些允许在客户端下载的技巧,其中一些不需要服务器端代码: 使用HTML5 / Javascript生成并保存文件 You ask if you can crea ...
-
data.inst.get_xml(“nest”, - 1,li_attr,a_attr)事件将当前xml作为字符串。 将其设置为隐藏输入字段。 提交表单时可以接收此隐藏字段值。 其余的可以由控制器照顾。 干杯,普林西 The data.inst.get_xml("nest", -1, li_attr, a_attr) event gives the current xml as a string. Set this as a hidden input field. This hidden field va ...
-
当我尝试保存XML文件时,用PHP调整标题就成了窍门: header("Content-Disposition: attachment; filename=file.xml"); 但是发送XML应该可以作为字符串。 你收到任何错误信息吗? Sorry to be answering my own question, but thought that it might be of use to someone else too. I did a if array_key_exists('xml_string ...
-
一个简单的方法是创建.NET类,然后使用XmlSerializer将数据序列化为文件,然后反序列化回类的实例并重新填充表单。 作为一个例子,如果你有一个包含客户数据的表单。 为了保持简短,我们将只有名字和姓氏。 您可以创建一个类来保存数据。 请记住,这只是一个简单的例子,您可以像这样存储数组和各种复杂/嵌套的数据。 public class CustomerData { public string FirstName; public string LastName; } 因此,将数据保存为XML, ...
-
将html表单数据保存到文件(Saving html form data to file)[2024-01-02]
如果你想保存表单数据在服务器端,我会用这样的php来做到这一点:myform 所以......最后我做到了。 还有一个小虫子 SystemId未知; 第#-1行; 列#-1; 文件过早结束。 但我希望这不是很难解决的问题。 如下所示,输出流现在写入StringWriter,然后将StringWriter写入XML文件。 如果您将文件传递给StreamResult,我仍然无法理解为什么没有结果(文件刚被清除)。 可能只是我的手从错误的地方长出来。 我明天可能会做一点研究。 因此,方法executeWrite(...)发生了很大变化 protected void executeW ...提交表单时调用控制器函数comments.save。 我想你的控制器中没有save()函数,这是由缺省方法处理的,该方法使用表单xml文件来验证(你没有)。 重写我认为你的控制器应该在一个名为com_easyrating / controllers / comments.php的文件中 class EasyRatingControllerComments{ function save(){ // here you should be able to handle your input } ...你需要将数据发布到一个简单的php文件中...... 像url: 'story.php'在那个php文件中使用fopen创建一个'story.json'并存储json 编辑:如果你想使用serialize()不是使用像这样的东西 data:{'mydata':$(this).serialize()} 并在PHP文件中 parse_str($_POST['mydata'],$newarray) ; echo json_encode($newarray); You need to post data to ...您需要为program节点赋予永久性 ,为其赋予如下值: $xml->program = ""; 在向子节点添加子节点之前添加该行: $xml->program = ""; $xml->program->addChild('name', $name); $xml->program->addChild('date', $date); .... You need to make the program node permanent by assigning it a value like so: $xml- ...相关文章
更多- Log4j 随笔
- Solr 使用 Log4j
- Solr 使用 Log4j
- solr实例代码 import org.apache.solr.client.solrj.SolrServer
- LOG4J的配置
- Log4j 记录Log日志
- solr python client
- Solr 支持log4j
- log4j快速入门示例
- log4j配置介绍
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)