[rfc][icedtea-web] refactored logging
Jiri Vanek
jvanek at redhat.com
Tue Sep 10 13:19:43 PDT 2013
hi!
This patch is introducing bottleneck for all stdout/err and printstacktrace. By this it is first part of http://icedtea.classpath.org/wiki/IcedTea-Web#IcedTea-Web_1.5 "introduce new logging and think about abrt connection"
Inspiration:
- get rid of repeated if JNLPRuntime.isDebug
- log properly into syslog (comming as next patch(*)(**) after this one s in)
- also C part will log into syslog in simialr way - Pavel is on it
- revive the old logger which logs into ~/..../logs to log more then few start up exception (if enabled)
- maybe something more, I got very asleep :)
The only real code is in extractedLogging-bottleNeck. The syslog writer(*) is not yet implemented and will be inside method write, which is now just dummy
(**) The best way how to integrate the syslogs writer is still under research (tcp?, exec?)
The extractedLogging-refactoring is extremely long, And I do not expect somebody to read it whole.
It is moreover just all the same:
- if (JNLPRuntime.isDebug())
- System.err.println("UNIQUEKEY=" + this.uniqueKey);
+ ItwLogger.getLogger().logErrorStream("UNIQUEKEY=" + this.uniqueKey);
or
- if (JNLPRuntime.isDebug())
- ex.printStackTrace();
+ ItwLogger.getLogger().log(ex);
or its variants without if (JNLPRuntime.isDebug()) and so adding "true" parameter which force logging always:
- System.err.println("UNIQUEKEY=" + this.uniqueKey);
+ ItwLogger.getLogger().logErrorStream(true, "UNIQUEKEY=" + this.uniqueKey);
or
- ex.printStackTrace();
+ ItwLogger.getLogger().log(true, ex);
And hope I did not miss something or not changed if debug/if not debug (/me have to try reprodcuers with/without patch)
The only real changes are minor and are in
/tests/netx/unit/net/sourceforge/jnlp/DefaultLaunchHandlerTest.java
and removed duplicated code arround exceptionToString.
netx/net/sourceforge/jnlp/ParseException.java (removed redundant code 1.3 compatibility..hehe)
ps: Pavel had ordered this, so he should suffer the review O:P, but any comments to design welcomed
/me hopes to not do te whole by-hand refactoring again
J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extractedLogging-bottleNeck.patch
Type: text/x-patch
Size: 9040 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130910/9b037696/extractedLogging-bottleNeck.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extractedLogging-refactoring.patch
Type: text/x-patch
Size: 215078 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130910/9b037696/extractedLogging-refactoring.patch
More information about the distro-pkg-dev
mailing list