Hm... I think I'll use the stock throwing() API and its underlying stock THROWING marker.
I won't worry about possible future issues now, YAGNI! WRT adding methods to log4j-api interfaces, it sounds like would be locked out from doing so until 3.0 BUT look at http://docs.oracle.com/javase/specs/jls/se6/html/binaryComp.html: "... binary compatible changes that the Java programming language supports" ... "Adding new fields, methods, or constructors to an existing class or interface." Source compatibility is a different story. Gary On Fri, Mar 20, 2015 at 11:07 PM, Ralph Goers <[email protected]> wrote: > If you add those methods and someone is implementing their own Logger > without extending AbstractLogger then they will have a problem (i.e. - you > are breaking binary compatibility). Also, how are you going to implement > error(Marker, Throwable)? logMessage requires the message parameter. It > will either construct a Message or it expects one, so you might as well be > doing error(Marker, “”, Throwable). > > I guess I would also argue that not using the THROWING marker would break > the expected behavior of the call as is documented at > http://logging.apache.org/log4j/2.x/manual/flowtracing.html. If you want > to use your own Marker you might as well call error(). > > Ralph > > On Mar 20, 2015, at 7:19 PM, Gary Gregory <[email protected]> wrote: > > And now I'd also like to have > a org.apache.logging.log4j.Logger.throwing(Throwable, Marker) so I can > provide my own marker instead of the canned one. > > Thoughts on that? > > Gary > > On Fri, Mar 20, 2015 at 3:35 PM, Gary Gregory <[email protected]> > wrote: > >> I need: >> >> org.apache.logging.log4j.Logger.error(Marker, Throwable) >> >> But we have: >> >> org.apache.logging.log4j.Logger.error(Marker, String, Throwable) >> >> Thoughts on adding the new APIs (for all levels)? >> >> Gary >> >> -- >> E-Mail: [email protected] | [email protected] >> Java Persistence with Hibernate, Second Edition >> <http://www.manning.com/bauer3/> >> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> >> Spring Batch in Action <http://www.manning.com/templier/> >> Blog: http://garygregory.wordpress.com >> Home: http://garygregory.com/ >> Tweet! http://twitter.com/GaryGregory >> > > > > -- > E-Mail: [email protected] | [email protected] > Java Persistence with Hibernate, Second Edition > <http://www.manning.com/bauer3/> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> > Spring Batch in Action <http://www.manning.com/templier/> > Blog: http://garygregory.wordpress.com > Home: http://garygregory.com/ > Tweet! http://twitter.com/GaryGregory > > > -- E-Mail: [email protected] | [email protected] Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> Spring Batch in Action <http://www.manning.com/templier/> Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory
