You can create profile-specific configuration files, like application-local.properties and application-sandbox.properties, where you define the logback configurations for "local" and "sandbox" profiles respectively.
Place the shared properties in application.properties, which will be loaded across all profiles. The application-local.properties and application-sandbox.properties files will inherit from application.properties and can override specific settings as needed.