[rfc][icedtea-web] refactored logging

Jacob Wisor gitne at gmx.de
Wed Sep 11 11:24:13 PDT 2013


Omair Majid wrote:
> Hi Jiri,
> I am mostly interested in this patch as a user (especially if some else
> has agreed to a full review of this giant patch). But it caught my
> interest so I have a few questions.

I have always appreciated when an application transitioned from a custom logging 
solution or added support for a native system logging facility. So, it is fair 
to say I am interested in this too.
As Java currently does not provide an abstraction for native system logging 
facilities my question is: Where are you heading with this initiative?

> […]
>> Inspiration:
>>  - get rid of repeated if JNLPRuntime.isDebug
> I am sure it's not relevant here, but OpenJDK switched from:
> log(foo)
> to
> if (debug) {
>   log(foo)
> }
> in a couple of places due to performance reasons. Just something to keep
> in mind.

Perhaps this should be split off into a separate patch?

>>  - log properly into syslog (comming as next patch(*)(**) after this one
>> s in)
> This sounds (at once) really cool and really scary.
> Can you elaborate on exactly what you mean by syslog? Is it the syslog
> protocol as defined in RFC 3164? What if a syslog daemon is not running?
> Can you describe the motivation for logging into syslog? Is this
> somethings lots of other user programs do?

I am not sure whether this question can be answered in general. AFAICT, I am 
observing a shift especially in "business" applications transitioning to native 
system logging facilities. Where native system logging facilities may be syslog 
on Un*x like systems or the "Event Log" service in Windows. It is definitely a 
good idea and rather indicated for IcedTea-Web in my opinion. Having 
configurable logging options in IcedTea-Web is going to make admin's lives 
surely easier. But, native system logging support is probably going to require a 
dependency on a third party library like Apache's log4j.

> […]
> External-library?

I fear this is the only option if you want to have true native system logging 
support in IcedTea-Web. This is one of these field where Java has fallen behind. 
I do not how much of a problem this is — given J2SE API's current state — to add 
proper syslog support on Un*x systems in an application like IcedTea-Web but 
adding support for Windows' Event Log service definitely requires native 
bindings to Win32 API (which log4j does provide). In fact, there should be less 
of a problem with the plug-in itself because it is built and compiled for a 
specific native target system anyway. So, adding system dependent code with the 
help of the preprocessor is easy.


More information about the distro-pkg-dev mailing list