I am using Neo4j 3.2.1 community edition and IntelliJ IDEA Ultimate 2017.1 with JUnit 4.12 and Java 8.
I get the org.neo4j.logging.Log object in the procedure class using:
@Context
public Log log;
and then am using it in the methods:
log.info("Info message...");
This works just fine when running neo4j and calling the extension, but the logs are not visible when running from inside Intellij using the server instance created in the JUnit test.
My test code looks like this:
package graphEngine;
import GraphComponents.TestGraphQueries;
import org.junit.Rule;
import org.junit.Test;
import org.neo4j.driver.v1.Config;
import org.neo4j.driver.v1.Driver;
import org.neo4j.driver.v1.GraphDatabase;
import org.neo4j.driver.v1.Session;
import org.neo4j.harness.junit.Neo4jRule;
public class ComputeTest {
@Rule
public Neo4jRule neo4j = new Neo4jRule()
.withProcedure(Compute.class)
.withProcedure(TestGraphQueries.class);
@Test
public void shouldFindMatchingSystems() throws Throwable {
try(Driver driver = GraphDatabase.driver( neo4j.boltURI() , Config.build()
.withEncryptionLevel( Config.EncryptionLevel.NONE ).toConfig() );
Session session = driver.session() ) {
session.run("CALL graphEngine.loadGraph");
session.run("CALL graphEngine.compute(8)");
}
}
}
The log file seems to go to a directory where the server instance is run that is created during execution but then is deleted immediately after.
Is there a way I can set the location for the log file and see the logs printed to the IntelliJ run/debug console?