-
Bug
-
Resolution: Done
-
Major
-
7.0.0.CR2
-
None
- RESTEasy don't use correct logging on many places. Loggers should be used instead of "System.out.println" and similar methods. Wrong logging is used often in RESTEasy project in tests, but it is used also in RESTEasy code.
- Incorrect logging could cause performance issues in RESTEasy or in WildFly.
- Some numbers:
[mkopecky@localhost Resteasy] (master)$ git grep "System.out.println" | grep -v docbook | wc -l 2713 [mkopecky@localhost Resteasy] (master)$ git grep "System.out.println" | grep -vi test | grep -v examples | grep -v arquillian | grep -v docbook | wc -l 60 [mkopecky@localhost Resteasy] (master)$ git grep "printStackTrace" | grep -v docbook | wc -l 98 [mkopecky@localhost Resteasy] (master)$ git grep "printStackTrace" | grep -vi test | grep -v examples | grep -v arquillian | grep -v docbook | wc -l 35 [mkopecky@localhost Resteasy] (master)$
These cases are most critical, because it is part of RESTEasy code (not tests), that is included in WildFly:
jaxrs/providers/jaxb/src/main/java/org/jboss/resteasy/plugins/providers/jaxb/IgnoredMediaTypes.java: System.out.println(getVendorString("foo+json")); jaxrs/providers/jaxb/src/main/java/org/jboss/resteasy/plugins/providers/jaxb/IgnoredMediaTypes.java: System.out.println(getSubtype("foo+json")); jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartFormDataReader.java: System.out.println(new String(baos.toByteArray())); jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java: System.out.println(multipart.getPreamble()); jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java: System.out.println("**********"); jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java: System.out.println("--"); jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java: System.out.println("\"" + part.getBodyAsString() + "\""); jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java: System.out.println("done"); jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartReader.java: System.out.println(writer.toString()); jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/util/Base64.java: e.printStackTrace(); jaxrs/resteasy-wadl/src/main/java/org/jboss/resteasy/wadl/ResteasyWadlDefaultResource.java: e.printStackTrace();
But correct logging should be in whole RESTEasy project.
RESTEasy has even some kind of check of usage of "System.out.println", "System.err.println" and "printStackTrace":
https://github.com/resteasy/Resteasy/blob/master/jaxrs/config/jboss_checks.xml#L121
- is cloned by
-
RESTEASY-1356 RESTEasy don't use correct logging on many places
- Resolved
- is related to
-
JBEAP-4901 Use JDK8 Base64 impl in RESTEasy
- Closed
-
JBEAP-9423 Base64 class uses printStackTrace method
- Closed