Re: [jgroups-dev] Logging and Inheritance

Bela Ban <[email protected]>
Newsgroups gmane.comp.java.javagroups.devel
Message-ID <[email protected]>
Can't reproduce this, do you have some sample code which throws 
exceptions ? I injected a few exceptions, and the line numbers were 
always correct

Amin Abbaspour wrote:
> Hi all,
>
> I believe it's better to define logger in each class rather than using inheritance, i.e.:
>
> private static final Log log = LogFactory.getLog(MyClassName.class);
>
> It's like this in right now (see Protocol.java):
>
> protected final Log log=LogFactory.getLog(this.getClass());
>
> This adds a small bit of code but prevent incorrect line numbers in log. 
>
> With current model one may see a message in UDP:896 while logger class is UDP and line number belongs to TP.java.
>
> Of course this means that every log call in TP results in logging via TP logger not the inherited one, which is bearable IMHO. 
>
>
>   

-- 
Bela Ban
Lead JGroups / JBoss Clustering team
JBoss - a division of Red Hat


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Javagroups-development mailing list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.