Logging components and Java EE

It can be tempting to reuse Java EE to implement logging components. It is not impossible, but there are some points to consider before doing so:

  • JUL doesn't always support the loading of classes with the container or application classloader, so you may need a facade implementation that contextually loads the container or application classes. In other words, you will not always be able to programmatically depend on CDI, but you may need some reflection which has a cost you want to minimize. So, make sure to keep the results of your CDI lookup if you can.
  • In the first chapters, we looked at the Java EE layers. Make sure you don't rely on something too heavy for a logger implementation to avoid being impacted ...

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.