Oh cool, I didn’t even see pattern selectors! Definitely the way to go here.
On Sun, Aug 12, 2018 at 12:19, Ralph Goers <ralph.go...@dslextreme.com> wrote: > Also, if you want to do something more complex you can implement your own > PatternSelector or use the ScriptPatternSelect. > > Ralph > > > On Aug 12, 2018, at 8:47 AM, Gary Gregory <garydgreg...@gmail.com> > wrote: > > > > Hi All: > > > > In our server, there are certain kinds of exceptions that are caught > that I > > want processed in a special manner. One example of this is for various > > kinds of time outs that surface as exceptions. Sometimes comms time out, > > requests may be resubmitted, and in general all is well. > > > > For day-to-day logging, I only want to show the _message_ of exception as > > an informative log event (INFO). I do not want to log the stack trace in > > this mode, as this alarms users to no end. > > > > When I am in trouble shooting mode, I do want to see the exception's > stack > > trace logged, say, at the DEBUG (or TRACE) level. > > > > Currently, I have some selective call sites with ugly logic to handle > this > > kind of logging. The simplest way to handle this is with some double > > logging: > > > > logger.info("foo: {}}, exception.toString()); > > logger.debug(exception); > > > > This is obviously ugly and a pain to maintain. > > > > Can you all think of how this could be addressed, either at the API site > or > > at the _pattern_ definition site? Maybe with a new option in the pattern? > > > > Gary > > > -- Matt Sicker <boa...@gmail.com>