/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2012 Red Hat, Inc., and individual contributors
 * as indicated by the @author tags.
 *
 * 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.undertow;

import java.io.File;
import java.io.IOException;

import org.jboss.logging.BasicLogger;
import org.jboss.logging.Cause;
import org.jboss.logging.LogMessage;
import org.jboss.logging.Logger;
import org.jboss.logging.Message;
import org.jboss.logging.MessageLogger;
import org.xnio.IoFuture;

/**
 * log messages start at 5000
 *
 * @author Stuart Douglas
 */
@MessageLogger(projectCode = "UNDERTOW")
public interface UndertowLogger extends BasicLogger {

    UndertowLogger ROOT_LOGGER = Logger.getMessageLogger(UndertowLogger.class, UndertowLogger.class.getPackage().getName());

    UndertowLogger REQUEST_LOGGER = Logger.getMessageLogger(UndertowLogger.class, UndertowLogger.class.getPackage().getName() + ".request");

    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 5000, value = "HttpServerExchange.getRequestChannel() has been called without also calling " +
            "HttpServerExchange.getResponseChannel(), the request is going to be automatically closed which will " +
            "cancel any async reads taking place on the request Channel")
    void getRequestCalledWithoutGetResponse();

    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 5001, value = "An exception occurred processing the request")
    void exceptionProcessingRequest(@Cause Throwable cause);

    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 5002, value = "An exception occurred closing the response channel")
    void errorClosingResponseChannel(@Cause Exception e);

    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 5003, value = "An exception occurred getting the session")
    void getSessionFailed(@Cause IOException exception);

    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 5004, value = "Unexpected state in session callback %s")
    void unexpectedStatusGettingSession(IoFuture.Status status);

    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 5005, value = "Could not send session cookie as response has already started")
    void couldNotSendSessionCookieAsResponseAlreadyStarted();

    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 5006, value = "Could not invalidate session cookie as response has already started")
    void couldNotInvalidateSessionCookieAsResponseAlreadyStarted();

    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 5007, value = "Could not find session cookie config in the request, session will not be persistent across requests")
    void couldNotFindSessionCookieConfig();

    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 5008, value = "Configured error page %s was not found")
    void errorPageDoesNotExist(File file);

    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 5009, value = "Exception reading error page %s")
    void errorLoadingErrorPage(@Cause final IOException e, final File file);
}

@@ -1514,780 +1514,195 @@
  500
-0, value = %22HttpServerExchange.getRequestChannel() has been called without also calling %22 +%0A            %22HttpServerExchange.getResponseChannel(), the request is going to be automatically closed which will %22 +%0A            %22cancel any async reads taking place on the request Channel%22)%0A    void getRequestCalledWithoutGetResponse();%0A%0A    @LogMessage(level = Logger.Level.ERROR)%0A    @Message(id = 5001, value = %22An exception occurred processing the request%22)%0A    void exceptionProcessingRequest(@Cause Throwable cause);%0A%0A    @LogMessage(level = Logger.Level.ERROR)%0A    @Message(id = 5002, value = %22An exception occurred closing the response channel%22)%0A    void errorClosingResponseChannel(@Cause Exception e);%0A%0A    @LogMessage(level = Logger.Level.ERROR)%0A    @Message(id = 5003
+1, value = %22An exception occurred processing the request%22)%0A    void exceptionProcessingRequest(@Cause Throwable cause);%0A%0A    @LogMessage(level = Logger.Level.ERROR)%0A    @Message(id = 5002
 , va
@@ -1879,9 +1879,9 @@
  500
-4
+3
 , va
@@ -2060,17 +2060,17 @@
 id = 500
-5
+4
 , value 
@@ -2268,9 +2268,9 @@
  500
-6
+5
 , va
@@ -2484,9 +2484,9 @@
  500
-7
+6
 , va
@@ -2708,9 +2708,9 @@
  500
-8
+7
 , va
@@ -2870,9 +2870,9 @@
  500
-9
+8
 , va

Tidy up messages