コード例 #1
0
        private static string GetLocksDescriptionFunction(Locks locks)
        {
            StringWriter stringWriter = new StringWriter();

            locks.Accept(new DumpLocksVisitor(FormattedLog.withUTCTimeZone().toWriter(stringWriter)));
            return(stringWriter.ToString());
        }
コード例 #2
0
            public override string Extract(string providerId)
            {
                StringWriter stringWriter = new StringWriter();
                ZoneId       zoneId       = Config.get(GraphDatabaseSettings.db_timezone).ZoneId;

                FormattedLog.Builder logBuilder = FormattedLog.withZoneId(zoneId);
                Diagnostics.extract(providerId, logBuilder.ToWriter(stringWriter));
                return(stringWriter.ToString());
            }
コード例 #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void setupAuthManager(org.neo4j.server.security.auth.AuthenticationStrategy authStrategy) throws Throwable
        private void SetupAuthManager(AuthenticationStrategy authStrategy)
        {
            FormattedLog.Builder builder = FormattedLog.withUTCTimeZone();
            _securityLogWriter = new StringWriter();
            Log log = builder.ToWriter(_securityLogWriter);

            _securityLog = new SecurityLog(log);
            InternalFlatFileRealm internalFlatFileRealm = new InternalFlatFileRealm(_users, new InMemoryRoleRepository(), new BasicPasswordPolicy(), authStrategy, mock(typeof(JobScheduler)), new InMemoryUserRepository(), new InMemoryUserRepository()
                                                                                    );

            _manager = new MultiRealmAuthManager(internalFlatFileRealm, Collections.singleton(internalFlatFileRealm), new MemoryConstrainedCacheManager(), _securityLog, true, false, Collections.emptyMap());
            _manager.init();
        }
コード例 #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public SecurityLog(org.neo4j.kernel.configuration.Config config, org.neo4j.io.fs.FileSystemAbstraction fileSystem, java.util.concurrent.Executor executor) throws java.io.IOException
        public SecurityLog(Config config, FileSystemAbstraction fileSystem, Executor executor)
        {
            ZoneId logTimeZoneId = config.Get(GraphDatabaseSettings.db_timezone).ZoneId;
            File   logFile       = config.Get(SecuritySettings.security_log_filename);

            FormattedLog.Builder builder = FormattedLog.withZoneId(logTimeZoneId);

            _rotatingSupplier = new RotatingFileOutputStreamSupplier(fileSystem, logFile, config.Get(SecuritySettings.store_security_log_rotation_threshold), config.Get(SecuritySettings.store_security_log_rotation_delay).toMillis(), config.Get(SecuritySettings.store_security_log_max_archives), executor);

            FormattedLog formattedLog = builder.ToOutputStream(_rotatingSupplier);

            formattedLog.Level = config.Get(SecuritySettings.security_log_level);

            this._inner = formattedLog;
        }
コード例 #5
0
        public override void Init()
        {
            lock (this)
            {
                // This set of settings are currently not dynamic:
                _currentLogTimeZone  = _config.get(GraphDatabaseSettings.db_timezone).ZoneId;
                _logBuilder          = FormattedLog.withZoneId(_currentLogTimeZone);
                _currentQueryLogFile = _config.get(GraphDatabaseSettings.log_queries_filename);

                UpdateSettings();

                RegisterDynamicSettingUpdater(GraphDatabaseSettings.log_queries);
                RegisterDynamicSettingUpdater(GraphDatabaseSettings.log_queries_threshold);
                RegisterDynamicSettingUpdater(GraphDatabaseSettings.log_queries_rotation_threshold);
                RegisterDynamicSettingUpdater(GraphDatabaseSettings.log_queries_max_archives);
                RegisterDynamicSettingUpdater(GraphDatabaseSettings.log_queries_runtime_logging_enabled);
                RegisterDynamicSettingUpdater(GraphDatabaseSettings.log_queries_parameter_logging_enabled);
                RegisterDynamicSettingUpdater(GraphDatabaseSettings.log_queries_page_detail_logging_enabled);
                RegisterDynamicSettingUpdater(GraphDatabaseSettings.log_queries_allocation_logging_enabled);
                RegisterDynamicSettingUpdater(GraphDatabaseSettings.log_queries_detailed_time_logging_enabled);
            }
        }