/*
 * Copyright 2016 Lime - HighTech Solutions s.r.o.
 *
 * Licensed 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 io.getlime.push;

import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * Spring Boot main class
 */
@SpringBootApplication
@EnableBatchProcessing
public class PowerAuthPushServerJavaApplication {

    /**
     * Main method
     *
     * @param args Arguments
     */
    public static void main(String[] args) {
        SpringApplication.run(PowerAuthPushServerJavaApplication.class, args);
    }
}

@@ -842,137 +842,1108 @@
 n;%0A%0A
-/**%0A * Spring Boot main class%0A */%0A@SpringBootApplication%0A@EnableBatchProcessing%0Apublic class PowerAuthPushServerJavaApplication %7B
+import java.util.logging.ConsoleHandler;%0Aimport java.util.logging.Handler;%0Aimport java.util.logging.Logger;%0Aimport java.util.logging.LogManager;%0A%0A/**%0A * Spring Boot main class%0A */%0A@SpringBootApplication%0A@EnableBatchProcessing%0Apublic class PowerAuthPushServerJavaApplication %7B%0A%0A    static %7B%0A        // TODO temporary workaround for Spring boot duplicate logging issue on Tomcat:%0A        // https://github.com/spring-projects/spring-boot/issues/13470%0A        Logger rootLogger = LogManager.getLogManager().getLogger(%22%22);%0A        Handler%5B%5D handlers = rootLogger.getHandlers();%0A        for (Handler handler : handlers) %7B%0A            // By default Tomcat adds ConsoleHandler to root logger which needs to be removed to avoid duplicate logging.%0A            // Removal of handlers during SLF4J initialization does not happen automatically after migration to Spring boot 2.0.0.%0A            // Once the issue is fixed in Spring boot project, we should remove this workaround.%0A            if (handler instanceof ConsoleHandler) %7B%0A                rootLogger.removeHandler(handler);%0A            %7D%0A        %7D%0A    %7D
 %0A%0A  

Fix #125: Duplicate log messages