Search in sources :

Example 31 with LogProvider

use of org.neo4j.logging.LogProvider in project neo4j by neo4j.

the class CommunityEditionModule method createRoutingProcedureInstaller.

@Override
protected AbstractRoutingProcedureInstaller createRoutingProcedureInstaller(GlobalModule globalModule, DatabaseManager<?> databaseManager, ClientRoutingDomainChecker clientRoutingDomainChecker) {
    ConnectorPortRegister portRegister = globalModule.getConnectorPortRegister();
    Config config = globalModule.getGlobalConfig();
    LogProvider logProvider = globalModule.getLogService().getInternalLogProvider();
    return new SingleInstanceRoutingProcedureInstaller(databaseManager, clientRoutingDomainChecker, portRegister, config, logProvider);
}
Also used : ConnectorPortRegister(org.neo4j.configuration.connectors.ConnectorPortRegister) LogProvider(org.neo4j.logging.LogProvider) Config(org.neo4j.configuration.Config) SingleInstanceRoutingProcedureInstaller(org.neo4j.procedure.builtin.routing.SingleInstanceRoutingProcedureInstaller)

Example 32 with LogProvider

use of org.neo4j.logging.LogProvider in project neo4j by neo4j.

the class StoreFactoryTest method storeFactory.

private StoreFactory storeFactory(Config config, PageCacheTracer pageCacheTracer, ImmutableSet<OpenOption> openOptions) {
    LogProvider logProvider = NullLogProvider.getInstance();
    RecordFormats recordFormats = selectForStoreOrConfig(config, databaseLayout, fileSystem, pageCache, logProvider, NULL);
    return new StoreFactory(databaseLayout, config, idGeneratorFactory, pageCache, fileSystem, recordFormats, logProvider, pageCacheTracer, writable(), openOptions);
}
Also used : LogProvider(org.neo4j.logging.LogProvider) NullLogProvider(org.neo4j.logging.NullLogProvider) RecordFormats(org.neo4j.kernel.impl.store.format.RecordFormats)

Example 33 with LogProvider

use of org.neo4j.logging.LogProvider in project neo4j by neo4j.

the class TokenStoreTestTemplate method setUp.

@BeforeEach
void setUp() throws IOException {
    Path file = dir.file("label-tokens.db");
    Path idFile = dir.file("label-tokens.db.id");
    Path namesFile = dir.file("label-tokens.db.names");
    Path namesIdFile = dir.file("label-tokens.db.names.id");
    IdGeneratorFactory generatorFactory = new DefaultIdGeneratorFactory(fs, immediate(), DEFAULT_DATABASE_NAME);
    LogProvider logProvider = NullLogProvider.getInstance();
    RecordFormats formats = RecordFormatSelector.defaultFormat();
    Config config = Config.defaults();
    nameStore = new DynamicStringStore(namesFile, namesIdFile, config, IdType.LABEL_TOKEN_NAME, generatorFactory, pageCache, logProvider, TokenStore.NAME_STORE_BLOCK_SIZE, formats.dynamic(), formats.storeVersion(), writable(), DEFAULT_DATABASE_NAME, immutable.empty());
    store = instantiateStore(file, idFile, generatorFactory, pageCache, logProvider, nameStore, formats, config);
    nameStore.initialise(true, NULL);
    store.initialise(true, NULL);
    nameStore.start(NULL);
    store.start(NULL);
}
Also used : Path(java.nio.file.Path) LogProvider(org.neo4j.logging.LogProvider) NullLogProvider(org.neo4j.logging.NullLogProvider) RecordFormats(org.neo4j.kernel.impl.store.format.RecordFormats) Config(org.neo4j.configuration.Config) DefaultIdGeneratorFactory(org.neo4j.internal.id.DefaultIdGeneratorFactory) IdGeneratorFactory(org.neo4j.internal.id.IdGeneratorFactory) DefaultIdGeneratorFactory(org.neo4j.internal.id.DefaultIdGeneratorFactory) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 34 with LogProvider

use of org.neo4j.logging.LogProvider in project neo4j by neo4j.

the class FabricServicesBootstrap method bootstrapServices.

public void bootstrapServices() {
    LogProvider internalLogProvider = logService.getInternalLogProvider();
    @SuppressWarnings("unchecked") var databaseManager = (DatabaseManager<DatabaseContext>) resolve(DatabaseManager.class);
    var fabricDatabaseManager = register(createFabricDatabaseManager(fabricConfig), FabricDatabaseManager.class);
    var jobScheduler = resolve(JobScheduler.class);
    var monitors = resolve(Monitors.class);
    var databaseAccess = createFabricDatabaseAccess();
    var remoteExecutor = bootstrapRemoteStack();
    var localExecutor = register(new FabricLocalExecutor(fabricConfig, fabricDatabaseManager, databaseAccess), FabricLocalExecutor.class);
    var systemNanoClock = resolve(SystemNanoClock.class);
    var transactionMonitor = register(new FabricTransactionMonitor(systemNanoClock, logService, fabricConfig), FabricTransactionMonitor.class);
    var transactionCheckInterval = config.get(GraphDatabaseSettings.transaction_monitor_check_interval).toMillis();
    register(new TransactionMonitorScheduler(transactionMonitor, jobScheduler, transactionCheckInterval, null), TransactionMonitorScheduler.class);
    var errorReporter = new ErrorReporter(logService);
    register(new TransactionManager(remoteExecutor, localExecutor, errorReporter, fabricConfig, transactionMonitor, securityLog, systemNanoClock, config, availabilityGuard), TransactionManager.class);
    var cypherConfig = CypherConfiguration.fromConfig(config);
    Supplier<GlobalProcedures> proceduresSupplier = () -> resolve(GlobalProcedures.class);
    var catalogManager = register(createCatalogManger(), CatalogManager.class);
    var signatureResolver = new SignatureResolver(proceduresSupplier);
    var statementLifecycles = new FabricStatementLifecycles(databaseManager, monitors, config, systemNanoClock);
    var monitoredExecutor = jobScheduler.monitoredJobExecutor(CYPHER_CACHE);
    var cacheFactory = new ExecutorBasedCaffeineCacheFactory(job -> monitoredExecutor.execute(systemJob("Query plan cache maintenance"), job));
    var planner = register(new FabricPlanner(fabricConfig, cypherConfig, monitors, cacheFactory, signatureResolver), FabricPlanner.class);
    var useEvaluation = register(new UseEvaluation(catalogManager, proceduresSupplier, signatureResolver), UseEvaluation.class);
    register(new FabricReactorHooksService(errorReporter), FabricReactorHooksService.class);
    Executor fabricWorkerExecutor = jobScheduler.executor(FABRIC_WORKER);
    var fabricExecutor = new FabricExecutor(fabricConfig, planner, useEvaluation, catalogManager, internalLogProvider, statementLifecycles, fabricWorkerExecutor);
    register(fabricExecutor, FabricExecutor.class);
    register(new TransactionBookmarkManagerFactory(fabricDatabaseManager), TransactionBookmarkManagerFactory.class);
}
Also used : FabricStatementLifecycles(org.neo4j.fabric.executor.FabricStatementLifecycles) FabricExecutor(org.neo4j.fabric.executor.FabricExecutor) DatabaseManager(org.neo4j.dbms.database.DatabaseManager) FabricDatabaseManager(org.neo4j.fabric.FabricDatabaseManager) SignatureResolver(org.neo4j.fabric.pipeline.SignatureResolver) UseEvaluation(org.neo4j.fabric.eval.UseEvaluation) FabricTransactionMonitor(org.neo4j.fabric.transaction.FabricTransactionMonitor) TransactionMonitorScheduler(org.neo4j.kernel.impl.api.transaction.monitor.TransactionMonitorScheduler) GlobalProcedures(org.neo4j.kernel.api.procedure.GlobalProcedures) LogProvider(org.neo4j.logging.LogProvider) ErrorReporter(org.neo4j.fabric.transaction.ErrorReporter) FabricLocalExecutor(org.neo4j.fabric.executor.FabricLocalExecutor) ThrowingFabricRemoteExecutor(org.neo4j.fabric.executor.ThrowingFabricRemoteExecutor) FabricRemoteExecutor(org.neo4j.fabric.executor.FabricRemoteExecutor) Executor(java.util.concurrent.Executor) FabricExecutor(org.neo4j.fabric.executor.FabricExecutor) FabricLocalExecutor(org.neo4j.fabric.executor.FabricLocalExecutor) ExecutorBasedCaffeineCacheFactory(org.neo4j.cypher.internal.cache.ExecutorBasedCaffeineCacheFactory) TransactionBookmarkManagerFactory(org.neo4j.fabric.bookmark.TransactionBookmarkManagerFactory) TransactionManager(org.neo4j.fabric.transaction.TransactionManager) FabricPlanner(org.neo4j.fabric.planning.FabricPlanner)

Example 35 with LogProvider

use of org.neo4j.logging.LogProvider in project neo4j-documentation by neo4j.

the class EmbeddedNeo4jWithCustomLogging method main.

public static void main(final String[] args) throws IOException {
    FileUtils.deleteDirectory(databaseDirectory);
    Object output = new Object();
    // tag::startDbWithLogProvider[]
    LogProvider logProvider = new MyCustomLogProvider(output);
    managementService = new DatabaseManagementServiceBuilder(databaseDirectory).setUserLogProvider(logProvider).build();
    // end::startDbWithLogProvider[]
    shutdown();
}
Also used : LogProvider(org.neo4j.logging.LogProvider) DatabaseManagementServiceBuilder(org.neo4j.dbms.api.DatabaseManagementServiceBuilder)

Aggregations

LogProvider (org.neo4j.logging.LogProvider)65 NullLogProvider (org.neo4j.logging.NullLogProvider)26 Config (org.neo4j.kernel.configuration.Config)16 File (java.io.File)15 Test (org.junit.Test)15 Log (org.neo4j.logging.Log)14 FormattedLogProvider (org.neo4j.logging.FormattedLogProvider)11 FileSystemAbstraction (org.neo4j.io.fs.FileSystemAbstraction)10 OnDemandJobScheduler (org.neo4j.test.OnDemandJobScheduler)9 Config (org.neo4j.configuration.Config)7 LogService (org.neo4j.kernel.impl.logging.LogService)7 DummyRaftableContentSerializer (org.neo4j.causalclustering.core.consensus.log.DummyRaftableContentSerializer)6 StoreFactory (org.neo4j.kernel.impl.store.StoreFactory)6 Monitors (org.neo4j.kernel.monitoring.Monitors)6 DependencyResolver (org.neo4j.graphdb.DependencyResolver)5 DefaultIdGeneratorFactory (org.neo4j.internal.id.DefaultIdGeneratorFactory)5 RecordFormats (org.neo4j.kernel.impl.store.format.RecordFormats)5 IOException (java.io.IOException)4 Path (java.nio.file.Path)4 NeoStores (org.neo4j.kernel.impl.store.NeoStores)4