<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000">I'm curious, when you run
the attached project, what do you get for the console output? Since it
has FOOBAR in the pattern, I would have expected to see FOOBAR on the
console. Instead, I still see the default display:<br>
<br>
19:34:45.088 [main] INFO helloworld.HelloWorld - hello world!<br>
<br>
Is that what you get when you the project that you attached?<br>
<br>
Thanks,<br>
Roger<br>
<blockquote style="border: 0px none;"
cite="mid:CAPrNtJfBKfYdrPyhqUKB3dc3VxK9W811COkizmxUx4C4m3Qs7Q@mail.gmail.com"
type="cite">
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="tony19@gmail.com" photoname="Tony Trinh"
src="cid:part1.03040509.05020208@northweststate.edu"
name="compose-unknown-contact.jpg" height="25px" width="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
<a moz-do-not-send="true" href="mailto:tony19@gmail.com"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Tony Trinh</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">January 20, 2012
1:34 PM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><div>Put logback.xml into the
root of your src directory (not in a subdir). This<br>worked fine for me
(see attached Netbeans project).<br><br>The output you were seeing was
from the<br>BasicConfigurator<a class="moz-txt-link-rfc2396E" href="http://logback.qos.ch/apidocs/ch/qos/logback/classic/BasicConfigurator.html"><http://logback.qos.ch/apidocs/ch/qos/logback/classic/BasicConfigurator.html></a><br>(loaded<br>by
default when logback.xml is not found in your classpath), which uses
the<br>ConsoleAppender. It just so happens that your logback.xml also
uses the<br>same type of appender, which might have confused you into
thinking that<br>Logback was ignoring the specified pattern in your
configuration.<br><br><br>On Fri, Jan 20, 2012 at 12:07 PM, Roger Spears<br></div><div><!----><br></div><div>_______________________________________________<br>Logback-user
mailing list<br><a class="moz-txt-link-abbreviated" href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br><a class="moz-txt-link-freetext" href="http://mailman.qos.ch/mailman/listinfo/logback-user">http://mailman.qos.ch/mailman/listinfo/logback-user</a></div></div>
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="rspears@northweststate.edu" photoname="Roger Spears"
src="cid:part1.03040509.05020208@northweststate.edu"
name="compose-unknown-contact.jpg" height="25px" width="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
<a moz-do-not-send="true" href="mailto:rspears@northweststate.edu"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Roger Spears</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">January 20, 2012
12:07 PM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody">Hello,
<br>
<br>I'm running Netbeans 7.0.1 on a Mac Book Pro with OS Lion. I'm
currently using log4j without any problems. I wanted to try out
logback.
<br>
<br>Yesterday I downloaded logback and placed the 4 jar files in the
proper
location. I'm able to run the basic logback HelloWorld example. Here's
the code for the HelloWorld example I'm working with:
<br>
<br>package helloworld;
<br>
<br>import org.slf4j.Logger;
<br>import org.slf4j.LoggerFactory;
<br>
<br>public class HelloWorld {
<br>
<br> public static void main(String[] args) {
<br>
<br> Logger logger = LoggerFactory.getLogger("helloworld");
<br> logger.debug("Hello world.");
<br>
<br> }
<br>
<br>}
<br>
<br>Here's my customized logback.xml file:
<br>
<br><configuration>
<br><appender name="STDOUT"
class="ch.qos.logback.core.ConsoleAppender">
<br><encoder>
<br><pattern>%date %n [%thread] %level %logger{35} - %n
%msg</pattern>
<br></encoder>
<br></appender>
<br><root level="DEBUG">
<br><appender-ref ref="STDOUT" />
<br></root>
<br></configuration>
<br>
<br>The problem is...Netbeans (or java) never picks up on my customized
logback.xml file. I'm starting out easy by just changing the pattern to
see if I can get it to work. When I run the project, I see the
following on the console:
<br>
<br>11:56:33.569 [main] DEBUG helloworld - Hello world.
<br>
<br>That's not the pattern I specified in logback.xml.
<br>
<br>I'm assuming I just don't have it in the proper location. I have a
copy
of logback.xml in the following locations just to see if I had it in the
wrong place:
<br>
<br>NetBeansProjects -> HelloWorld -> src -> logback.xml
<br>
<br>NetBeansProjects -> HelloWorld -> logback.xml
<br>
<br>NetBeansProjects -> HelloWorld -> nbproject -> private
-> logback.xml
<br>
<br>NetBeansProjects -> HelloWorld -> build -> classes ->
logback.xml
<br>
<br>System -> Libraries -> Java -> Extensions -> logback.xml
<br>
<br>
<br>I am still unable to get the pattern I'm looking for.
<br>
<br>Does anyone know why this would be happening?
<br>
<br>Thanks,
<br>Roger
<br></div>
</blockquote>
<br>
<div class="moz-signature">-- <br>Roger Spears<br>
Training Coordinator<br>
Northwest State Community College<br>
22600 State Route 34<br>
Archbold, Ohio 43502<br>
P: 419-267-1304<br>
F: 419-267-3891<br>
<br>
*********************<br>
These records are protected by the Family Educational Rights and Privacy
Act (FERPA) and are provided under an exception to the Act found
in Section 99.32. These records must be maintained confidentially
and may not be re disclosed. They must be destroyed when your
legitimate educational interest no longer exists. If you are not the
intended recipient you are hereby notified that any disclosure, copying,
distribution or use of the contents of this information is prohibited.
If you have received this email transmission in error, please notify me
by telephone or via return email and delete this email from your system.<br>
<br>
<a class="moz-txt-link-freetext" href="http://www2.ed.gov/policy/gen/reg/ferpa/index.html">http://www2.ed.gov/policy/gen/reg/ferpa/index.html</a><span
style="mso-bookmark:OLE_LINK1"><span style="mso-bookmark:OLE_LINK2"><span
style="font-size:11.0pt;font-family:"Times New Roman""><o:p></o:p></span></span></span><span>
</span></div>
</body></html>