Commit a9e0bf0c05eb96c6f45c1d7b8d29b330dd807837
1 parent
72954459
Exists in
master
FWK-202: Injeção de java.util.logging.Logger
Task-Url: https://demoiselle.atlassian.net/browse/FWK-202
Showing
6 changed files
with
14 additions
and
17 deletions
Show diff stats
impl/extension/rest/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/AuthenticationExceptionMapper.java
... | ... | @@ -2,12 +2,12 @@ package br.gov.frameworkdemoiselle.internal.implementation; |
2 | 2 | |
3 | 3 | import static javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED; |
4 | 4 | |
5 | +import java.util.logging.Logger; | |
6 | + | |
5 | 7 | import javax.ws.rs.core.Response; |
6 | 8 | import javax.ws.rs.ext.ExceptionMapper; |
7 | 9 | import javax.ws.rs.ext.Provider; |
8 | 10 | |
9 | -import org.slf4j.Logger; | |
10 | - | |
11 | 11 | import br.gov.frameworkdemoiselle.security.AuthenticationException; |
12 | 12 | import br.gov.frameworkdemoiselle.util.Beans; |
13 | 13 | import br.gov.frameworkdemoiselle.util.NameQualifier; |
... | ... | @@ -19,7 +19,7 @@ public class AuthenticationExceptionMapper implements ExceptionMapper<Authentica |
19 | 19 | |
20 | 20 | @Override |
21 | 21 | public Response toResponse(AuthenticationException exception) { |
22 | - getLogger().info(exception.getMessage()); | |
22 | + getLogger().warning(exception.getMessage()); | |
23 | 23 | return Response.status(SC_UNAUTHORIZED).entity(exception.getMessage()).type("text/plain").build(); |
24 | 24 | } |
25 | 25 | ... | ... |
impl/extension/rest/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/AuthorizationExceptionMapper.java
... | ... | @@ -2,12 +2,12 @@ package br.gov.frameworkdemoiselle.internal.implementation; |
2 | 2 | |
3 | 3 | import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN; |
4 | 4 | |
5 | +import java.util.logging.Logger; | |
6 | + | |
5 | 7 | import javax.ws.rs.core.Response; |
6 | 8 | import javax.ws.rs.ext.ExceptionMapper; |
7 | 9 | import javax.ws.rs.ext.Provider; |
8 | 10 | |
9 | -import org.slf4j.Logger; | |
10 | - | |
11 | 11 | import br.gov.frameworkdemoiselle.security.AuthorizationException; |
12 | 12 | import br.gov.frameworkdemoiselle.util.Beans; |
13 | 13 | import br.gov.frameworkdemoiselle.util.NameQualifier; |
... | ... | @@ -19,7 +19,7 @@ public class AuthorizationExceptionMapper implements ExceptionMapper<Authorizati |
19 | 19 | |
20 | 20 | @Override |
21 | 21 | public Response toResponse(AuthorizationException exception) { |
22 | - getLogger().info(exception.getMessage()); | |
22 | + getLogger().warning(exception.getMessage()); | |
23 | 23 | return Response.status(SC_FORBIDDEN).build(); |
24 | 24 | } |
25 | 25 | ... | ... |
impl/extension/rest/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/ConstraintViolationExceptionMapper.java
1 | 1 | package br.gov.frameworkdemoiselle.internal.implementation; |
2 | 2 | |
3 | 3 | import java.util.Iterator; |
4 | +import java.util.logging.Logger; | |
4 | 5 | |
5 | 6 | import javax.validation.ConstraintViolation; |
6 | 7 | import javax.validation.ConstraintViolationException; |
... | ... | @@ -8,8 +9,6 @@ import javax.ws.rs.core.Response; |
8 | 9 | import javax.ws.rs.ext.ExceptionMapper; |
9 | 10 | import javax.ws.rs.ext.Provider; |
10 | 11 | |
11 | -import org.slf4j.Logger; | |
12 | - | |
13 | 12 | import br.gov.frameworkdemoiselle.UnprocessableEntityException; |
14 | 13 | import br.gov.frameworkdemoiselle.util.Beans; |
15 | 14 | import br.gov.frameworkdemoiselle.util.NameQualifier; |
... | ... | @@ -32,7 +31,7 @@ public class ConstraintViolationExceptionMapper implements ExceptionMapper<Const |
32 | 31 | failed.addViolation(violation.getPropertyPath().toString(), violation.getMessage()); |
33 | 32 | } |
34 | 33 | |
35 | - getLogger().debug(getBundle().getString("mapping-violations", status, failed.getViolations().toString())); | |
34 | + getLogger().fine(getBundle().getString("mapping-violations", status, failed.getViolations().toString())); | |
36 | 35 | return Response.status(status).entity(failed.getViolations()).build(); |
37 | 36 | } |
38 | 37 | ... | ... |
impl/extension/rest/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/DefaultExceptionMapper.java
1 | 1 | package br.gov.frameworkdemoiselle.internal.implementation; |
2 | 2 | |
3 | +import static java.util.logging.Level.SEVERE; | |
3 | 4 | import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR; |
4 | 5 | |
5 | 6 | import java.util.ResourceBundle; |
7 | +import java.util.logging.Logger; | |
6 | 8 | |
7 | 9 | import javax.ws.rs.core.Response; |
8 | 10 | import javax.ws.rs.ext.ExceptionMapper; |
9 | 11 | import javax.ws.rs.ext.Provider; |
10 | 12 | |
11 | -import org.slf4j.Logger; | |
12 | - | |
13 | 13 | import br.gov.frameworkdemoiselle.util.Beans; |
14 | 14 | import br.gov.frameworkdemoiselle.util.NameQualifier; |
15 | 15 | |
... | ... | @@ -23,7 +23,7 @@ public class DefaultExceptionMapper implements ExceptionMapper<Throwable> { |
23 | 23 | @Override |
24 | 24 | public Response toResponse(Throwable exception) { |
25 | 25 | String message = getBundle().getString("internal.server.error"); |
26 | - getLogger().error(message, exception); | |
26 | + getLogger().log(SEVERE, message, exception); | |
27 | 27 | |
28 | 28 | return Response.status(INTERNAL_SERVER_ERROR).entity(message).build(); |
29 | 29 | } | ... | ... |
impl/extension/rest/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/HttpViolationExceptionMapper.java
1 | 1 | package br.gov.frameworkdemoiselle.internal.implementation; |
2 | 2 | |
3 | 3 | import java.util.Set; |
4 | +import java.util.logging.Logger; | |
4 | 5 | |
5 | 6 | import javax.ws.rs.core.Response; |
6 | 7 | import javax.ws.rs.ext.ExceptionMapper; |
7 | 8 | import javax.ws.rs.ext.Provider; |
8 | 9 | |
9 | -import org.slf4j.Logger; | |
10 | - | |
11 | 10 | import br.gov.frameworkdemoiselle.HttpViolationException; |
12 | 11 | import br.gov.frameworkdemoiselle.HttpViolationException.Violation; |
13 | 12 | import br.gov.frameworkdemoiselle.util.Beans; |
... | ... | @@ -29,7 +28,7 @@ public class HttpViolationExceptionMapper implements ExceptionMapper<HttpViolati |
29 | 28 | if (violations.isEmpty()) { |
30 | 29 | violations = null; |
31 | 30 | } else { |
32 | - getLogger().debug(getBundle().getString("mapping-violations", status, violations.toString())); | |
31 | + getLogger().fine(getBundle().getString("mapping-violations", status, violations.toString())); | |
33 | 32 | } |
34 | 33 | |
35 | 34 | return Response.status(status).entity(violations).build(); | ... | ... |
impl/extension/rest/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/MetadataREST.java
... | ... | @@ -3,6 +3,7 @@ package br.gov.frameworkdemoiselle.internal.implementation; |
3 | 3 | import static javax.ws.rs.core.MediaType.TEXT_HTML; |
4 | 4 | |
5 | 5 | import java.util.ResourceBundle; |
6 | +import java.util.logging.Logger; | |
6 | 7 | |
7 | 8 | import javax.inject.Inject; |
8 | 9 | import javax.ws.rs.GET; |
... | ... | @@ -10,8 +11,6 @@ import javax.ws.rs.Path; |
10 | 11 | import javax.ws.rs.PathParam; |
11 | 12 | import javax.ws.rs.Produces; |
12 | 13 | |
13 | -import org.slf4j.Logger; | |
14 | - | |
15 | 14 | import br.gov.frameworkdemoiselle.NotFoundException; |
16 | 15 | import br.gov.frameworkdemoiselle.ServiceUnavailableException; |
17 | 16 | import br.gov.frameworkdemoiselle.util.Metadata; | ... | ... |