Re: LogFactory.getLog()

2010-08-08 Thread Doug Bateman
It just isn't my day. It's rainy here. Here we go: https://issues.apache.org/jira/browse/LOGGING-137 On Sun, Aug 8, 2010 at 3:56 PM, Doug Bateman wrote: > https://issues.apache.org/jira/secure/ManageAttachments.jspa?id=12471073 > > On Sun, Aug 8, 2010 at 11:58 AM, Doug Bateman wrote: > >> Here

Re: LogFactory.getLog()

2010-08-08 Thread Doug Bateman
https://issues.apache.org/jira/secure/ManageAttachments.jspa?id=12471073 On Sun, Aug 8, 2010 at 11:58 AM, Doug Bateman wrote: > Here's the JIRA issue. > > Sebb, you're right, it seems the Thread.getStackTrace() is Java 1.5, while > Throwable.getStackTrace() is Java 1.4. I probably should use th

Re: LogFactory.getLog()

2010-08-08 Thread Doug Bateman
Here's the JIRA issue. Sebb, you're right, it seems the Thread.getStackTrace() is Java 1.5, while Throwable.getStackTrace() is Java 1.4. I probably should use the Throwable.getStackTrace() instead. I had started there, which is where the Java 1.4 assumption came from. On Sun, Aug 8, 2010 at 5:0

Re: LogFactory.getLog()

2010-08-08 Thread sebb
; >> Presently, in Apache Commons, the most common way to get a logger is to do >> something like: >> >> public class MyClass { >>     private static Log log = LogFactory.getLog(MyClass.class); >> } >> >> Notice how MyClass.class (or alternatively a s

Re: LogFactory.getLog()

2010-08-07 Thread James Carman
On Sat, Aug 7, 2010 at 7:28 PM, Torsten Curdt wrote: > > For me that's exactly the other way around - most of the time I don't > need the static access. > But, if you use static, you can access the log both ways. > > > (log objects aren't serializable for instance) > > How is that a problem? >

Re: LogFactory.getLog()

2010-08-07 Thread Torsten Curdt
> That can't be used most of the time For me that's exactly the other way around - most of the time I don't need the static access. > (log objects aren't serializable for instance) How is that a problem? > and it's inefficient. http://c2.com/cgi/wiki?PrematureOptimization

Re: LogFactory.getLog()

2010-08-07 Thread James Carman
That can't be used most of the time (log objects aren't serializable for instance) and it's inefficient. 2010/8/7 Torsten Curdt : > private Log log = LogFactory.getLog(this.getClass()); > > http://wiki.apache.org/commons/Logging/StaticLog > > > On Sat, Aug 7,

Re: LogFactory.getLog()

2010-08-07 Thread Torsten Curdt
private Log log = LogFactory.getLog(this.getClass()); http://wiki.apache.org/commons/Logging/StaticLog On Sat, Aug 7, 2010 at 18:36, Ted Dunning wrote: > This really would be nice to have. > > Sent from my iPhone > > On Aug 6, 2010, at 8:36 PM, "cmaj1

Re: LogFactory.getLog()

2010-08-07 Thread Ted Dunning
This really would be nice to have. Sent from my iPhone On Aug 6, 2010, at 8:36 PM, "cmaj135" wrote: nod cmaj135 2010-08-07 发件人: Doug Bateman 发送时间: 2010-08-07 10:11:35 收件人: Commons Developers List 抄送: 主题: LogFactory.getLog() Dear Commons Developers, Here's a sug

Re: LogFactory.getLog()

2010-08-06 Thread James Carman
; something like: > > public class MyClass { >     private static Log log = LogFactory.getLog(MyClass.class); > } > > Notice how MyClass.class (or alternatively a string name) is passed as a > parameter.  The annoying aspect of this is that sometimes the class name > does

Re: LogFactory.getLog()

2010-08-06 Thread cmaj135
nod cmaj135 2010-08-07 发件人: Doug Bateman 发送时间: 2010-08-07 10:11:35 收件人: Commons Developers List 抄送: 主题: LogFactory.getLog() Dear Commons Developers, Here's a suggestion for the commons-logging package... Presently, in Apache Commons, the most common way to get a logger is

Re: LogFactory.getLog()

2010-08-06 Thread Doug Bateman
Correction, the sample is Java 1.1+ compatible. I used a PrintWriter (although I could remove that).

LogFactory.getLog()

2010-08-06 Thread Doug Bateman
Dear Commons Developers, Here's a suggestion for the commons-logging package... Presently, in Apache Commons, the most common way to get a logger is to do something like: public class MyClass { private static Log log = LogFactory.getLog(MyClass.class); } Notice how MyClass.clas