You can't really match this use with the static pointcuts available to declare error. Under the covers this is just a call to
StringBuilder.append with a Throwable instance, but there's no way to say the static type of the argument is a Throwable. Another strategy would be to flag an error if you log without logging the exception inside a handler, but you can't say
lexically within handler in an AspectJ pointcut, and you can't use cflow for declare error/warning.
However, what you might want to do instead is to ADD the stack trace in advice:
I have declaration in my class using org.apache.log4j.Logger: private static final Logger log = Logger.getLogger(PrihlaskaReportBean.class);
And i would like to ask for hint about how to formulate declare error
pointcut, which could capture following:
log.error("some message" + e);
I want to capture this logging usage, because the "+ e" calls e.toString(), which causes to print only the message without stacktrace(stacktrace i want
to see always).