users@javaee-spec.java.net

[javaee-spec users] [jsr342-experts] Re: Logs. Should we finally do something ?

From: Werner Keil <werner.keil_at_gmail.com>
Date: Fri, 9 Mar 2012 16:00:42 +0100

Antonio,

Beside Modularization (Jigsaw vs. OSGi,...) with Logging you just put your
finger into a very big, bleeding wound[?]
In fact, the way you mentioned an example configuration, log levels are
tightly coupled to modules, though it doesn't matter so much in this
respect if those are managed via OSGi like several app servers do or other
mechanisms. What does matter and it is the case with Java EE and several
JSRs or components, is that the logging framework considered available was
of course java.util.logging. And other projects often disregarded that
either because they know or like Log4J, and others better (I am not getting
into the discussion which is better or why, that's a whole thread of itself
[?])

Fact is, let's assume, a Java EE server or project/app XYZ chose Log4J,
SLF4J or even their own home-grown logging framework, they still have at
least 1, 2 or more additional frameworks the runtime carries along. At
least java.util.logging which until proper and useful modularization is in
place nobody gets rid of. Thus, if you look at it like that, for Java EE it
is the de facto standard that's always available, whether you like it or
not.

Werner

On Fri, Mar 9, 2012 at 3:43 PM, Antonio Goncalves <
antonio.goncalves_at_gmail.com> wrote:

> Hi all,
>
> We are in 2012 and I just spent a few hours trying to display the logs of
> an application on GlassFish 3.1.2 and JBoss 7.1.0 (and it's not the first
> time in my career). Modules to exclude in one, jars to add in the
> WEB-INF/lib on the other... or to exclude. And of course, that's just my
> application Log4j logs. If I want to have more logs on javax.ejb I need to
> setup a different file in JBoss and another one in GlassFish.
>
> I know javax.util.logging exists in Java SE but nobody tends to use it
> (despite GlassFish uses it and JBoss has a brand new logger that wraps
> java.util.logging), I know we can happily choose from 10 fashionable brand
> new logging frameworks... but really, it's a pain. Every application uses
> logs. Every framework uses logs. Every Java EE spec implementation uses
> logs. For an application to be portable across app servers, for a
> configuration file to be portable across Java EE specs, we should do
> something.
>
> I would love to write :
>
> javax.ejb.level = debug
> javax.persistence.level = debug
> org.weld.level = debug
> my.app.level = debug
>
> Add this config file under WEB-INF/classes and don't worry about anything
> else... and have the same behavior under GlassFish, JBoss or whatever.
>
> Logging frameworks have been a battle since day one and it's one of the
> things that make me feel the Java ecosystem is too complex and is slowly
> fading from developers/ops concerns. Gosh, I just want to display some
> logs, why do I have to choose from 10 different frameworks and why should I
> battle with app server configuration.
>
> Isn't it the role of the Java EE spec to make the other spec agree to a
> standard ? And what about logging ?
>
> Antonio
>



-- 
 Werner Keil | JCP Executive Committee Member (ME) | Eclipse UOMo Lead
 Twitter @wernerkeil | #Java_Social | #EclipseUOMo | #OpenDDR
Skype werner.keil | Google+ gplus.to/wernerkeil
* geecon: May 16 2012, PoznaƄ, Poland. Werner Keil, JCP EC Member, Social
JSR Co-Spec Lead will present "Java EE 7"
* JustJava: May 19-20 2012, Sao Paulo, Brazil. Werner Keil, JCP EC
Member, Social
JSR Co-Spec Lead will present "Java Social"
* Dutch Mobile Conference: June 7-9 2012, Amsterdam, Netherlands. Werner
Keil, JCP EC (ME) Member, OpenDDR Evangelist will present "OpenDDR"




329.gif
(image/gif attachment: 329.gif)

362.gif
(image/gif attachment: 362.gif)