Controlling logging

Neo4j embedded provides logging via its own org.neo4j.logging.Log layer and does not natively use any existing Java logging framework. All logging events produced by Neo4j have a name, a level, and a message. The name is а fully qualified class name (FQCN).

Table 1. Neo4j uses the following log levels:
Level Name Description

ERROR

For serious errors that are almost always fatal.

WARN

For events that are serious, but not fatal.

INFO

Informational events.

DEBUG

Debugging events.

To enable logging, an implementation of org.neo4j.logging.LogProvider must be provided to the org.neo4j.dbms.api.DatabaseManagementServiceBuilder, as follows:

LogProvider logProvider = new MyCustomLogProvider( output );
managementService = new DatabaseManagementServiceBuilder( databaseDirectory ).setUserLogProvider( logProvider ).build();