code: public static void configureLogstashEncoderDefaults(final Level level) {
      final Logger rootLogger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
      final LoggerContext context = rootLogger.getLoggerContext();
  
      context.reset();
  
      final CustomLogstashEncoder encoder = new CustomLogstashEncoder().setupStackdriver();
      encoder.setContext(context);
      encoder.start();
  
      final ConsoleAppender<ILoggingEvent> appender = new ConsoleAppender<ILoggingEvent>();
      appender.setTarget("System.out");
      appender.setName("stdout");
      appender.setEncoder(encoder);
      appender.setContext(context);
      appender.start();
  
      rootLogger.addAppender(appender);
      rootLogger.setLevel(level.logbackLevel);
  
      UncaughtExceptionLogger.setDefaultUncaughtExceptionHandler();
    }
docs: Configure logging with the LogstashEncoder library.
  (https://github.com/logstash/logstash-logback-encoder)
  
  An appender is configured to send the log messages to stdout. It is expected something like
  a Docker container will capture these logs for further processing.