@Override public void info( String s ) { log.info( s ); }
@Override public void available() { log.info( "Database %s is ready.", databaseName ); }
@Override public void recoveryCleanupRegistered() { log.info( "Label index cleanup job registered" ); }
@Override public void recoveryRequired( LogPosition startPosition ) { log.info( "Recovery required from position " + startPosition ); }
@Override public void recoveryCleanupClosed() { log.info( "Label index cleanup job closed" ); }
private void reportPercent( int percent ) { if ( percent % STRIDE == 0 ) { log.info( format( " %d%% completed", percent ) ); } }
@Override public void rotationSucceeded( File source, File target, Headers headers ) { log.info( format( "Rotated counts store at transaction %d to [%s], from [%s].", headers.get( FileVersion.FILE_VERSION ).txId, target, source ) ); }
@Override public void recoveryCleanupStarted( File indexFile, IndexDescriptor indexDescriptor ) { log.info( "Schema index cleanup job started: " + indexDescription( indexFile, indexDescriptor ) ); }
private void addShutdownHook() { shutdownHook = new Thread( () -> { log.info( "Neo4j Server shutdown initiated by request" ); doShutdown(); } ); Runtime.getRuntime().addShutdownHook( shutdownHook ); }
@Override public void info( String s, Object... objects ) { log.info( slf4jToStringFormatPlaceholders( s ), objects ); }
@Override public void recoveryCleanupFailed( File indexFile, IndexDescriptor indexDescriptor, Throwable throwable ) { log.info( String.format( "Schema index cleanup job failed: %s.%nCaused by: %s", indexDescription( indexFile, indexDescriptor ), ExceptionUtils.getStackTrace( throwable ) ) ); }
@Override public ProgressReporter startSection( String name ) { log.info( format( "Migrating %s (%d/%d):", name, ++currentStage, numStages ) ); return new LogProgressReporter( log ); }
@Override public void recoveryCleanupFinished( File indexFile, IndexDescriptor indexDescriptor, long numberOfPagesVisited, long numberOfCleanedCrashPointers, long durationMillis ) { StringJoiner joiner = new StringJoiner( ", ", "Schema index cleanup job finished: " + indexDescription( indexFile, indexDescriptor ) + " ", "" ); joiner.add( "Number of pages visited: " + numberOfPagesVisited ); joiner.add( "Number of cleaned crashed pointers: " + numberOfCleanedCrashPointers ); joiner.add( "Time spent: " + duration( durationMillis ) ); log.info( joiner.toString() ); }
@Override public void run() throws E { super.run(); log.info( "Completed node store scan. " + "Flushing all pending updates." + EOL + BatchingMultipleIndexPopulator.this ); flushAll(); } }
public void triggerIndexSampling( SchemaDescriptor descriptor, IndexSamplingMode mode ) throws IndexNotFoundKernelException { String description = descriptor.userDescription( tokenNameLookup ); internalLog.info( "Manual trigger for sampling index " + description + " [" + mode + "]" ); samplingController.sampleIndex( indexMapRef.getIndexId( descriptor ), mode ); }
@Test void shouldNotWriteLogIfLevelIsHigherThanWritten() { // Given StringWriter writer = new StringWriter(); Log log = newFormattedLog( writer, Level.WARN ); // When log.info( "I know now why you cry. But it's something I can never do." ); // Then assertThat( writer.toString(), equalTo( "" ) ); }
@Test void logShouldFailAndWriteNothingForInvalidParametersArray() { // Given StringWriter writer = new StringWriter(); Log log = newFormattedLog( writer ); assertThrows( IllegalFormatException.class, () -> log.info( "%s like me. A T-%d, advanced prototype.", "Not", "1000", 1000 ) ); assertThat( writer.toString(), equalTo( "" ) ); }
public File doThreadDump( Pair<Long, String> pid ) throws Exception { File outputFile = new File( outputDirectory, fileName( "threaddump", pid ) ); log.info( "Creating thread dump of " + pid + " to " + outputFile.getAbsolutePath() ); String[] cmdarray = new String[] {"jstack", "" + pid.first()}; Process process = Runtime.getRuntime().exec( cmdarray ); writeProcessOutputToFile( process, outputFile ); return outputFile; }
@Procedure public Stream<MyOutputRecord> logAround() { log.debug( "1" ); log.info( "2" ); log.warn( "3" ); log.error( "4" ); return Stream.empty(); } }