Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ misses weaving logger pointcuts




Mike,

A simpler approach would be to add your own handler. Just specify the class
name in the logging.properties file. You can also override the default
LogManager which has a factory method for loggers.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/

Mike Haladin <mike.haladin@xxxxxx>@eclipse.org on 16/08/2005 12:03:10

Please respond to aspectj-users@xxxxxxxxxxx

Sent by:    aspectj-users-bounces@xxxxxxxxxxx


To:    aspectj-users@xxxxxxxxxxx
cc:
Subject:    [aspectj-users] AspectJ misses weaving logger pointcuts


Hi all,

    I have the current problem.

    I wish to redirect all calls to java.util.logging.Logger to a different
logger.

I have the following pointcuts:

    //matches the Logger initialization routine
  pointcut xpl_logget(String logname): call(Logger
Logger.getLogger(String)) && args(logname);

  //matches the log call with only a msg
  pointcut xpl_log(Level l, String msg): call(void Logger.log(Level,
String)) && args(l, msg);
  //matches the log call with one Object as a parameter
  pointcut xpl_logobject(Level l, String msg, Object param1): call(void
Logger.log(Level, String, Object)) && args(l, msg, param1);
  //matches the log call with many Objects as parameters
  pointcut xpl_logobjects(Level l, String msg, Object[] params): call(void
Logger.log(Level, String, Object[])) && args(l, msg, params);
  //matches the log call with an exception as a parameter
  pointcut xpl_logexception(Level l, String msg, Throwable thrown):
call(void Logger.log(Level, String, Throwable)) && args(l, msg, thrown);


  For some reason, I am unable to intercept all calls.  I can intercept
some, nut not all.  If I compile the same code, it appears to work.

  The only difference I can see is that the jar that i cannot seem to weave
completely is signed and built on another machine.

any ideas?  I am using Java 1.4

thanks,
Mike




                                                                            
                                                                            
 --                                                                         
                                                                            
                                                                            


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top