Results of ‘a small survey about logging’

I’ve recently conducted a survey about logging. Whilst it’s not a complete correct survey ( I left out Log4j2 oops! Sorry, next time better! And I will definitely try it out )

You can now follow up on the results here on RebelLabs , they gave me the opportunity to post the results there. And so I did. Head over to RebelLabs and read the summary!

uselogging

HTTP Status 7XX

Ever wanted to return obscure HTTP Status codes from your Jersey REST application?

Now you can easily get all HTTP Status codes from the 7XX ranged as proposed by some people at RailsCamp ( see spec ) just grab the status codes from here at github or pull em in as maven dependency with

<dependency>
  <groupId>be.redlab.jersey</groupId>
  <artifactId>http-7xx</artifactId>
  <version>1.0</version>
</dependency>

You can just send it with Jersey’s response like return

Response.status(HttpStatus7xx.A_KITTEN_DIES).build();

I know that Tomcat will not send the reason phrase. By default tomcat does not allow to set custom messages for statusses. To get tomcat to send the custom message you have to add a parameter at startup set

-Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true

and you will have the status message in your response.

I haven’t tested with other containers yet.

Have fun with 7XX !

Not everything is IT

Birthday cupcakes for one of my sons birthday.

image

Continue reading “Not everything is IT”