Maybe you need to look at AspectJ and Aspect Oriented Programming in general to address this "cross-cutting concern"?
regards, Wim 2008/6/13 Christophe Elek <[EMAIL PROTECTED]>: > > They are great discussion :) I really enjoy reading them :) > > I have one on my own. My goal in IBM Rational is to ensure all products > have a consistent set of logging so we can correlate the logs of all the > products. > Some are legacy products, some are new products. > > Developers and Architect always ask me... > 'Chris, really, do I have to create the 4 Logger in each of my class and > then figure out which logger to call ? > This is crazy... > Can't I just have an API like this > MyComponent.log(String,Exception) ?' > > My answer to them is that the component owner must create the API and I see > the following API > 1) MyComponent.createLogRecord(String messageKey,Object[] > parametersMessage,int severity,Throwable exception) > 2) MyComponent.error(MyLogRecord) or MyComponent.audit(MyLogRecord) or > MyComponent.traceHttp(MyLogRecord) > > > What do you think the minimal set of API should be ? Or should we force our > developers to become expert of Log4J ? > I know I can explain to them the value of logging, the value of software > engineering, quality of code...and so on... but seriously, If we come up > with a very simple set of API...wouldn't that make this discussion between > the developer and me easier ? > Christophe Elek - Senior Software Analyst > IBM Rational Serviceability Architect > IBM Toronto Lab 8200 Warden Avenue, Markham, Ontario, L6G 1C7 > Phone Number: (905) 413-3467 > Email: [EMAIL PROTECTED] > > "Don't just fix the mistakes - fix whatever permitted the mistake in the > first place." Charles Fishman