<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 17 Jul 2013, at 10:23, Stuart Rossiter <<a href="mailto:stuart.p.rossiter@gmail.com">stuart.p.rossiter@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">BTW (general question to the mailing list): this code suggests that the getLogger(Class clazz) form sets the logger name using the source file name (e.g., SLF4JConsoleTest.java here, cf. SLF4JConsoleTest). I've always used the getLogger(String name) form, passing SLF4JConsoleTest.class.getCanonicalName(), or getSimpleName() if I don't want the full name. (It might even be that I changed to that because of this ugly .java suffix, though I can't explicitly remember that.)</div><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br></div><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Is there a reason for that? If it's to link to the file producing it (rather than the class), that doesn't seem very useful without a path.</div></blockquote></div><br><div>Stuart, maybe you picked up this habit from java.util.logging which only allows string names to be passed when creating a logger.</div><div><br></div><div>I personally favour the "LoggerFactory.getLogger(MyClass.class)" form for the following reasons:</div><div> 1) Typo avoidance - if I misspell the class name, then the IDE and compiler will complain</div><div> 2) Tooling support - Find Usages, Rename Class refactorings will work without having to enable 'seach in strings'</div><div><br></div><div>There is no .java stuffix, just the .class suffix, and it's not so ugly, in fact the IDE makes it a pretty colour!  :-)</div><div><br></div><div>David</div></body></html>