[slf4j-dev] [Bug 163] Copy & paste of LoggerFactory.getLogger

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Wed Dec 16 04:25:33 CET 2009


http://bugzilla.slf4j.org/show_bug.cgi?id=163


Ralph Goers <rgoers at apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rgoers at apache.org




--- Comment #26 from Ralph Goers <rgoers at apache.org>  2009-12-16 04:25:32 ---
Actually, the way I would like to do this would be to use something like what
Seam already supports:

@Logger private Logger log;

http://www.tzavellas.com/techblog/2007/03/31/implementing-seam-style-logger-injection-with-spring/
shows one way of doing this. http://forums.sun.com/thread.jspa?threadID=5202309
describes this also and Google will lead to other samples.

I would also like:

@XLogger private XLogger log;

public class MyClass {

  @Trace Object doSomething(String arg) {
      ...
      return object;
  }
}

In this case doSomething would become:

Object doSomething(String arg) {
  log.entry(arg);
  ...
  log.exit(object);
  return object;
}

or even

Object doSomething(String arg) {
  log.entry(arg);
  try {
    ...
    log.exit(object);
    return object;
  } catch (Exception ex) {
    log.throwing(LocationAwareLogger.TRACE_INT, ex);
    throw ex;
  }
}


-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the slf4j-dev mailing list