日志密码查询

时间:2019-05-14 08:56:10

标签: java java-8 spring-data-neo4j

当我们使用spring jpa内置查询(如findById!)时,是否有方法记录生成的密码查询?我有一个复杂的内置查询,我需要查看其密码

2 个答案:

答案 0 :(得分:0)

Neo4j提供了记录所有已执行查询的功能。

https://neo4j.com/docs/operations-manual/current/monitoring/logging/query-logging

Neo4j可以配置为记录在数据库中执行的查询。

必须通过将dbms.logs.query.enabled参数设置为true来启用查询日志记录。参数dbms.logs.query.threshold确定记录查询的阈值。如果执行查询所花的时间比该阈值长,则将其记录下来。将dbms.logs.query.threshold设置为0将导致记录所有查询

答案 1 :(得分:0)

使用Spring Boot 2.1.5,我只需添加以下内容即可记录Spring Data Neo4j生成的Cypher查询:

if(isset($_POST['submit'])){
    $name=$_POST['name'];
    $email=$_POST['email'];
    $phone=$_POST['phone'];
    $msg=$_POST['msg'];

    $to='contact@justgaming.com';
    $subject='Form Submission';
    $message="Name :".$name."\n"."Phone :".$phone."\n"."Wrote the following :"."\n\n".$msg;
    $headers="From: ".$email;

    if(mail($to, $subject, $message, $headers)){
        echo "<h1>Sent Successfully! Thank you"." ".$name.", We will contact you shortly!</h1>";
    }
    else{
        echo "Something went wrong!";
    }
}

到application.properties。