diff --git a/pom.xml b/pom.xml
old mode 100755
new mode 100644
index a7cf76d9cd..9a021b67db
--- a/pom.xml
+++ b/pom.xml
@@ -35,7 +35,8 @@
1.1.1.Final
2.7.0.Final
3.2.0
- 3.1.4.GA
+ 3.3.0.Final
+ 2.0.1.Final
1.2.0.Beta1
1.0.4.Final
1.0.0.Final
@@ -297,6 +298,16 @@
jboss-logging
${jboss.logging.version}
+
+ org.jboss.logging
+ jboss-logging-annotations
+ ${jboss.logging.tools.version}
+
+
+ org.jboss.logging
+ jboss-logging-processor
+ ${jboss.logging.tools.version}
+
log4j
log4j
diff --git a/services/pom.xml b/services/pom.xml
index 3f7dba9618..64c4221995 100755
--- a/services/pom.xml
+++ b/services/pom.xml
@@ -57,6 +57,18 @@
org.jboss.logging
jboss-logging
+
+ org.jboss.logging
+ jboss-logging-annotations
+ provided
+ true
+
+
+ org.jboss.logging
+ jboss-logging-processor
+ provided
+ true
+
org.jboss.resteasy
resteasy-jaxrs
@@ -129,6 +141,9 @@
${maven.compiler.target}
+
+ -AgeneratedTranslationFilesPath=${project.build.directory}/generated-translation-files
+
diff --git a/services/src/main/java/org/keycloak/services/ServicesLogger.java b/services/src/main/java/org/keycloak/services/ServicesLogger.java
new file mode 100644
index 0000000000..e5c5029cf8
--- /dev/null
+++ b/services/src/main/java/org/keycloak/services/ServicesLogger.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2016 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @author tags. All rights reserved.
+ *
+ * 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 org.keycloak.services;
+
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Logger;
+import org.jboss.logging.annotations.Cause;
+import org.jboss.logging.annotations.LogMessage;
+import org.jboss.logging.annotations.Message;
+import org.jboss.logging.annotations.MessageLogger;
+
+import static org.jboss.logging.Logger.Level.ERROR;
+import static org.jboss.logging.Logger.Level.INFO;
+import static org.jboss.logging.Logger.Level.WARN;
+
+
+/**
+ * Main logger for the Keycloak Services module.
+ *
+ * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc.
+ */
+@MessageLogger(projectCode="KC-SERVICES", length=4)
+public interface ServicesLogger extends BasicLogger {
+
+ ServicesLogger ROOT_LOGGER = Logger.getMessageLogger(ServicesLogger.class, "org.keycloak.services");
+
+ @LogMessage(level = INFO)
+ @Message(id=1, value="Loading config from %s")
+ void loadingFrom(Object from);
+
+ @LogMessage(level = ERROR)
+ @Message(id=2, value="Failed to migrate datamodel")
+ void migrationFailure(@Cause Throwable t);
+
+ @LogMessage(level = INFO)
+ @Message(id=3, value="Not importing realm %s from %s. It already exists.")
+ void realmExists(String realmName, String from);
+
+ @LogMessage(level = INFO)
+ @Message(id=4, value="Imported realm %s from %s.")
+ void importedRealm(String realmName, String from);
+
+ @LogMessage(level = WARN)
+ @Message(id=5, value="Unable to import realm %s from %s.")
+ void unableToImportRealm(@Cause Throwable t, String realmName, String from);
+
+ @LogMessage(level = INFO)
+ @Message(id=6, value="Importing users from '%s'")
+ void imprtingUsersFrom(Object from);
+
+ @LogMessage(level = ERROR)
+ @Message(id=7, value="Failed to load 'keycloak-add-user.json'")
+ void failedToLoadUsers(@Cause Throwable t);
+
+ @LogMessage(level = ERROR)
+ @Message(id=8, value="Failed to add user %s to realm %s: realm not found")
+ void addUserFailedRealmNotFound(String user, String realm);
+
+ @LogMessage(level = INFO)
+ @Message(id=9, value="Added user '%s' to realm '%s'")
+ void addUserSuccess(String user, String realm);
+
+ @LogMessage(level = ERROR)
+ @Message(id=10, value="Failed to add user '%s' to realm '%s': user with username exists")
+ void addUserFailedUserExists(String user, String realm);
+
+ @LogMessage(level = ERROR)
+ @Message(id=11, value="Failed to add user '%s' to realm '%s'")
+ void addUserFailed(@Cause Throwable t, String user, String realm);
+
+ @LogMessage(level = ERROR)
+ @Message(id=12, value="Failed to delete '%s'")
+ void failedToDeleteFile(String fileName);
+}
diff --git a/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java b/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java
old mode 100755
new mode 100644
index c0842eecfd..e619183ec1
--- a/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java
+++ b/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java
@@ -3,7 +3,6 @@ package org.keycloak.services.resources;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import org.jboss.logging.Logger;
import org.jboss.resteasy.core.Dispatcher;
import org.jboss.resteasy.spi.ResteasyProviderFactory;
import org.keycloak.Config;
@@ -15,6 +14,7 @@ import org.keycloak.models.utils.RepresentationToModel;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.representations.idm.UserRepresentation;
import org.keycloak.services.DefaultKeycloakSessionFactory;
+import org.keycloak.services.ServicesLogger;
import org.keycloak.services.filters.KeycloakTransactionCommitter;
import org.keycloak.services.managers.ApplianceBootstrap;
import org.keycloak.services.managers.RealmManager;
@@ -44,7 +44,7 @@ import java.util.*;
*/
public class KeycloakApplication extends Application {
- private static final Logger log = Logger.getLogger(KeycloakApplication.class);
+ private static final ServicesLogger log = ServicesLogger.ROOT_LOGGER;
protected Set