[Date Prev][Date Next] [Chronological] [Thread] [Top]

Loggers...



Hi !

I was looking at some class (namely, the Config.java class), and I have
a few suggestions :

- First of all, and this is important, the code is currently using Log4j
as the logger. So far so good, but that means we will face some trouble
as soon as someone using a different logger will like to embed fortress.
We should use a facade instead (like SLF4j).

- We include two libs : log4j-1.2.16 and commons-logging-1.1.1. I don't
know why we include the second one (their may be some needed dependency
on it...) but if we could just get rid of it, that would be great. (I'm
not even sure it's used at all...)

- If we were to keep commons-logging, the updated version is 1.1.3

- There is no need to specify the class name in front of each log like in :
            log.info( CLS_NM + " static init: found from: " + propFile +
" path:" + fUrl.getPath() );
 The log pattern can be used to store this information in the logs

- If we were to use slf4j, such logs will be written :
            log.info( "Static init: found from: {} path: {}", propFile,
fUrl.getPath() );
 which save us teh computation of the resulting String if the Info mode
is not set.

- For any end user code that uses Fortress, we could use Log4j-1.2 [1]
which has just been released recently. It offers pretty good
performances [2]

Those are just suggestions...

wdyt ?

[1] http://logging.apache.org/log4j/1.2/
[2] http://logging.apache.org/log4j/2.x/performance.html

-- 
Regards,
Cordialement,
Emmanuel LÃcharny
www.iktek.com