/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package sshd.shell.springboot.autoconfiguration;

import java.util.Arrays;
import java.util.Collection;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;

/**
 *
 * @author anand
 */
@SpringBootApplication
@lombok.extern.slf4j.Slf4j
public class ConfigTest {

    @SuppressWarnings("deprecation")
    @Bean
    public AuthenticationProvider authProvider() {
        DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
        authProvider.setPasswordEncoder(NoOpPasswordEncoder.getInstance());
        authProvider.setUserDetailsService(username -> new UserDetails() {
            private static final long serialVersionUID = 1L;

            @Override
            public Collection<? extends GrantedAuthority> getAuthorities() {
                return Arrays.<GrantedAuthority>asList(new SimpleGrantedAuthority(
                        username.equals("alice") ? "ALICE" : "ADMIN"));
            }

            @Override
            public String getPassword() {
                return username;
            }

            @Override
            public String getUsername() {
                return username;
            }

            @Override
            public boolean isAccountNonExpired() {
                return true;
            }

            @Override
            public boolean isAccountNonLocked() {
                return true;
            }

            @Override
            public boolean isCredentialsNonExpired() {
                return true;
            }

            @Override
            public boolean isEnabled() {
                return true;
            }
        });
        return authProvider;
    }
}

@@ -846,16 +846,136 @@
 ation;%0A%0A
+import ch.qos.logback.classic.Level;%0Aimport ch.qos.logback.classic.Logger;%0Aimport ch.qos.logback.classic.LoggerContext;%0A
 import j
@@ -1016,24 +1016,56 @@
 Collection;%0A
+import org.slf4j.LoggerFactory;%0A
 import org.s
@@ -1709,16 +1709,261 @@
 Test %7B%0A%0A
+    public ConfigTest() %7B%0A        LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory();%0A        Logger rootLogger = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME);%0A        rootLogger.setLevel(Level.INFO);%0A    %7D%0A    %0A
     @Sup

Set log levels programmatically