Class LoggingConfiguration

java.lang.Object
io.github.jspinak.brobot.config.logging.LoggingConfiguration

@Configuration("loggingInfrastructureConfig") public class LoggingConfiguration extends Object
Spring configuration for the Brobot logging subsystem.

LoggingConfiguration provides a flexible logging infrastructure that allows different implementations of

invalid reference
LogSink
to be plugged in based on the deployment context. It establishes a no-operation default to ensure the framework functions even when no specific logging implementation is provided.

Design principles:

  • Extensibility: Applications can provide custom LogSink implementations
  • Safe defaults: NoOpLogSink ensures framework stability without logging
  • Spring integration: Uses conditional beans for flexible configuration

Common logging implementations:

  • invalid reference
    NoOpLogSink
    - Default, discards all log entries (no side effects)
  • DatabaseLogSink - Persists logs to a database (provided by runner module)
  • FileLogSink - Writes logs to files (custom implementation)
  • RemoteLogSink - Sends logs to external systems (custom implementation)

Usage example:


 // To provide a custom LogSink, define a bean in your configuration:
 @Configuration
 public class MyAppConfig {
     @Bean
     public LogSink customLogSink() {
         return new MyCustomLogSink();
     }
 }

 // The framework will automatically use your custom sink instead of NoOpLogSink
 

In the model-based approach, centralized logging is crucial for understanding action execution patterns, debugging automation failures, and building datasets for machine learning. This configuration ensures logging is always available while allowing deployment-specific customization.

See Also:
  • Constructor Details

    • LoggingConfiguration

      public LoggingConfiguration()