package com.gurkensalat.chronos;

import org.apache.commons.lang3.CharEncoding;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.ResourceBundleMessageSource;

@SpringBootApplication
public class Application
{
    public static void main(String[] args)
    {
        SpringApplication.run(Application.class, args);
    }

    protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
    {
        return application.sources(Application.class);
    }

    @Bean
    public ResourceBundleMessageSource messageSource()
    {
        ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
        messageSource.setBasename("i18n/messages");
        messageSource.setFallbackToSystemLocale(false);
        messageSource.setDefaultEncoding(CharEncoding.UTF_8);
        return messageSource;
    }
}

@@ -88,179 +88,728 @@
 org.
-springframework.boot.SpringApplication;%0Aimport org.springframework.boot.autoconfigure.SpringBootApplication;%0Aimport org.springframework.boot.builder.SpringApplicationBuild
+eclipse.jetty.server.Handler;%0Aimport org.eclipse.jetty.server.NCSARequestLog;%0Aimport org.eclipse.jetty.server.Server;%0Aimport org.eclipse.jetty.server.Slf4jRequestLog;%0Aimport org.eclipse.jetty.server.handler.HandlerCollection;%0Aimport org.eclipse.jetty.server.handler.RequestLogHandler;%0Aimport org.springframework.boot.SpringApplication;%0Aimport org.springframework.boot.autoconfigure.SpringBootApplication;%0Aimport org.springframework.boot.builder.SpringApplicationBuilder;%0Aimport org.springframework.boot.context.embedded.EmbeddedServletContainerFactory;%0Aimport org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory;%0Aimport org.springframework.boot.context.embedded.jetty.JettyServerCustomiz
 er;%0A
@@ -1613,11 +1613,1628 @@
 e;%0A    %7D
+%0A%0A    @Bean%0A    public EmbeddedServletContainerFactory jettyConfigBean()%0A    %7B%0A        JettyEmbeddedServletContainerFactory jef = new JettyEmbeddedServletContainerFactory();%0A%0A        jef.addServerCustomizers(new JettyServerCustomizer()%0A        %7B%0A            public void customize(Server server)%0A            %7B%0A                HandlerCollection handlers = new HandlerCollection();%0A                for (Handler handler : server.getHandlers())%0A                %7B%0A                    handlers.addHandler(handler);%0A                %7D%0A%0A                %7B%0A                    RequestLogHandler reqLogs = new RequestLogHandler();%0A%0A                    Slf4jRequestLog reqLogImpl = new Slf4jRequestLog();%0A                    reqLogImpl.setExtended(false);%0A                    reqLogs.setRequestLog(reqLogImpl);%0A%0A                    handlers.addHandler(reqLogs);%0A                %7D%0A%0A                %7B%0A                    RequestLogHandler reqLogs = new RequestLogHandler();%0A%0A                    String logdir = %22./env.PWD_IS_UNDEFINED/logs/%22;%0A%0A                    NCSARequestLog reqLogImpl = new NCSARequestLog(logdir + %22access-yyyy_mm_dd.log%22);%0A                    reqLogImpl.setRetainDays(30);%0A                    reqLogImpl.setAppend(true);%0A                    reqLogImpl.setExtended(false);%0A                    // TODO make log time zone configurable%0A                    reqLogImpl.setLogTimeZone(%22GMT+1%22);%0A                    reqLogs.setRequestLog(reqLogImpl);%0A%0A                    handlers.addHandler(reqLogs);%0A                %7D%0A%0A                server.setHandler(handlers);%0A            %7D%0A        %7D);%0A%0A        return jef;%0A    %7D
 %0A%7D%0A

Add HTTP traffic logging