Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Neo4j REST API日志记录_Neo4j - Fatal编程技术网

Neo4j REST API日志记录

Neo4j REST API日志记录,neo4j,Neo4j,我想在Neo4j v3.0.4中激活HTTP日志记录,包括日志文件中的完整请求和完整响应。我使用的是Windows10x64系统和Neo4j社区版3.0.4。 我发现了以下信息: 在stackoverflow,e。g、 : 我的问题是,在当前版本中找不到neo4j-server.properties文件。我认为,这个文件可以用neo4j.conf在当前版本中重命名,因为内容非常相似 到目前为止我所做的: 在neo4j.conf(目录:C:\Users\\AppData\Roaming\neo

我想在Neo4j v3.0.4中激活HTTP日志记录,包括日志文件中的完整请求和完整响应。我使用的是Windows10x64系统和Neo4j社区版3.0.4。 我发现了以下信息:

在stackoverflow,e。g、 :

我的问题是,在当前版本中找不到neo4j-server.properties文件。我认为,这个文件可以用neo4j.conf在当前版本中重命名,因为内容非常相似

到目前为止我所做的: 在neo4j.conf(目录:C:\Users\\AppData\Roaming\neo4j Community Edition)中更改了此参数:

在neo4j.conf中添加了以下参数:

    org.neo4j.server.http.unsafe.content_log.enabled=true
    org.neo4j.server.http.log.config=neo4j-http-logging.xml
在同一目录中创建了名为neo4j-http-logging.xml的新文件:

<configuration>
  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>data/log/http.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>data/log/http.%d{yyyy-MM-dd_HH}.log</fileNamePattern>
      <maxHistory>30</maxHistory>
    </rollingPolicy>

    <encoder>
      <!-- Note the deliberate misspelling of "referer" in accordance with RFC1616 -->
      <pattern>%h %l %user [%t{dd/MMM/yyyy:HH:mm:ss Z}] "%r" %s %b "%i{Referer}" "%i{User-Agent}" \n Request:\n %fullRequest \n Response: \n %fullResponse </pattern>
    </encoder>
  </appender>

  <appender-ref ref="FILE"/>
</configuration>
编辑2: 我的要求是:

    POST /db/data/node/1/paths?Accept=application/json; charset=UTF-8&amp;Content-Type=application/json HTTP/1.1
    Host: localhost:7474
    Authorization: Basic bmVvNGo6bmVvcGFzcw==
    Cache-Control: no-cache
    Postman-Token: 5eae944e-c556-d8f3-cfa1-1bfa92e86761

    {
      "to" : "http://localhost:7474/db/data/node/5",
      "cost_property" : "cost",
      "relationships" : {
        "type" : "connected_by",
        "direction" : "out"
      },
      "algorithm" : "dijkstra"
    }
响应是一个JSON对象,具有正确的结果

我注意到,根本没有使用neo4j-http-logging.xml。我可以更改配置,但不会影响日志。Neo4j文档v2.3.3中有一个标记被归类为“实验性”:

    org.neo4j.server.http.unsafe.content_log.enabled=true
必须在配置文件中设置以记录完整请求/响应。但是根据这个参数现在被删除了。
此外,我更新到了v3.0.6。

您能用当前写入http请求日志文件的内容更新您的问题吗?我更新了我的帖子,提前谢谢!谢谢你的编辑。您向neo4j发出的查询是什么?您是否得到任何结果?好的,这是我的新结果。我甚至不确定这是否可能。任何帮助都将不胜感激!:)您能用当前正在写入http请求日志文件的内容更新您的问题吗?我更新了我的帖子,提前谢谢!谢谢你的编辑。您向neo4j发出的查询是什么?您是否得到任何结果?好的,这是我的新结果。我甚至不确定这是否可能。任何帮助都将不胜感激!:)
    POST /db/data/node/1/paths?Accept=application/json; charset=UTF-8&amp;Content-Type=application/json HTTP/1.1
    Host: localhost:7474
    Authorization: Basic bmVvNGo6bmVvcGFzcw==
    Cache-Control: no-cache
    Postman-Token: 5eae944e-c556-d8f3-cfa1-1bfa92e86761

    {
      "to" : "http://localhost:7474/db/data/node/5",
      "cost_property" : "cost",
      "relationships" : {
        "type" : "connected_by",
        "direction" : "out"
      },
      "algorithm" : "dijkstra"
    }
    org.neo4j.server.http.unsafe.content_log.enabled=true