use of org.neo4j.logging.LogProvider in project neo4j by neo4j.
the class CommonAbstractStoreTest method newStore.
private TheStore newStore() {
LogProvider log = NullLogProvider.getInstance();
TheStore store = new TheStore(storeFile, config, idType, idGeneratorFactory, pageCache, log, recordFormat);
store.initialise(false);
return store;
}
use of org.neo4j.logging.LogProvider in project neo4j by neo4j.
the class LuceneLabelScanStoreExtension method newInstance.
@Override
public LabelScanStoreProvider newInstance(KernelContext context, Dependencies dependencies) throws Throwable {
Config config = dependencies.getConfig();
boolean ephemeral = config.get(GraphDatabaseFacadeFactory.Configuration.ephemeral);
FileSystemAbstraction fileSystem = dependencies.fileSystem();
DirectoryFactory directoryFactory = directoryFactory(ephemeral, fileSystem);
LuceneLabelScanIndexBuilder indexBuilder = getIndexBuilder(context, directoryFactory, fileSystem, config);
LogProvider logger = dependencies.getLogService().getInternalLogProvider();
Monitor loggingMonitor = new LoggingMonitor(logger.getLog(LuceneLabelScanStore.class), monitor);
LuceneLabelScanStore scanStore = new LuceneLabelScanStore(indexBuilder, new FullLabelStream(dependencies.indexStoreView()), loggingMonitor);
return new LabelScanStoreProvider(NAME, scanStore);
}
use of org.neo4j.logging.LogProvider in project neo4j by neo4j.
the class ConcurrentChangesOnEntitiesTest method assertDatabaseConsistent.
private void assertDatabaseConsistent() throws IOException {
LogProvider logProvider = FormattedLogProvider.toOutputStream(System.out);
try {
ConsistencyCheckService.Result result = new ConsistencyCheckService().runFullConsistencyCheck(testDirectory.graphDbDir(), Config.defaults(), ProgressMonitorFactory.textual(System.err), logProvider, false);
assertTrue(result.isSuccessful());
} catch (ConsistencyCheckIncompleteException e) {
fail(e.getMessage());
}
}
use of org.neo4j.logging.LogProvider in project neo4j by neo4j.
the class ServerBootstrapper method start.
@Override
@SafeVarargs
public final int start(File homeDir, Optional<File> configFile, Pair<String, String>... configOverrides) {
addShutdownHook();
try {
Config config = createConfig(homeDir, configFile, configOverrides);
LogProvider userLogProvider = setupLogging(config);
dependencies = dependencies.userLogProvider(userLogProvider);
log = userLogProvider.getLog(getClass());
config.setLogger(log);
serverAddress = config.httpConnectors().stream().filter(c -> Encryption.NONE.equals(c.encryptionLevel())).findFirst().map((connector) -> config.get(connector.listen_address).toString()).orElse(serverAddress);
checkCompatibility();
server = createNeoServer(config, dependencies, userLogProvider);
server.start();
return OK;
} catch (ServerStartupException e) {
e.describeTo(log);
return WEB_SERVER_STARTUP_ERROR_CODE;
} catch (TransactionFailureException tfe) {
String locationMsg = (server == null) ? "" : " Another process may be using database location " + server.getDatabase().getLocation();
log.error(format("Failed to start Neo4j on %s.", serverAddress) + locationMsg, tfe);
return GRAPH_DATABASE_STARTUP_ERROR_CODE;
} catch (Exception e) {
log.error(format("Failed to start Neo4j on %s.", serverAddress), e);
return WEB_SERVER_STARTUP_ERROR_CODE;
}
}
Aggregations