Red5 Documentation

Add Log Statements

Add Log Statements

Watch a demonstration of the current section
  1. Inside of eclipse, navigate to src > main > java
  2. Open ExampleApplication.java
  3. Add the following code inside of the appStart method.

        ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
    
        Runnable task = () -> log.debug("Scheduling: " + System.nanoTime());
    
        int initialDelay = 0;
        int period = 1;
        executor.scheduleAtFixedRate(task, initialDelay, period, TimeUnit.SECONDS);
  4. Verify that the code looks the same as https://github.com/red5pro/red5pro-dev-series/blob/master/06-application-level-logging/example/src/main/java/com/red5pro/example/ExampleApplication.java