<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000">Hello,<br>
<br>
Good catches! That was a little bit embarrassing to say the least.<br>
<br>
Unfortunately, I still get the standard response on my console:<br>
<br>
11:09:20.731 [main] INFO logtest.LogTest - hello world<br>
<br>
<br>
Also, I'm including two screen shots with this email. The first is a
shot of the corrected xml code. The second is a list of what's in my
library for this project. Maybe there's something there/not there that I
can correct?.?.<br>
<br>
<br>
<br>
<blockquote style="border: 0px none;"
cite="mid:CAPrNtJefnx1WyCb-iWW3-BAxNfqYcA+EH3XRu9VE0-kC-8OKzw@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.01080408.09090205@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 23, 2012
11:04 AM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><div>Also, your logback.xml is
missing a closing bracket for </configuration*>*.<br><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="tony19@gmail.com" photoname="Tony Trinh"
src="cid:part1.01080408.09090205@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 23, 2012
11:01 AM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><div>You might not have noticed
that your file is named "logback.xml*.xml*"<br>(with the extra .xml
extension). Try renaming that file to "logback.xml",<br>and then run it
again.<br><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.01080408.09090205@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 23, 2012
9:57 AM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody">Thank you for the
suggestion....Unfortunately, I get the same result....
<br>
<br>09:49:47.151 [main] INFO logtest.LogTest - hello world
<br>
<br>
<br>I followed your directions with the exception of naming the class
HelloWorld. I named it LogTest.
<br>
<br>When I right clicked on Source Package and added new xml file,
Netbeans
created the <default package> folder on its own.
<br>
<br>
<br>I'm attaching two screen shots of my netbeans setup.
<br>
<br>The first screen shot is LogTest.java and the second is logback.xml.
<br>
<br>Thanks,
<br>Roger
<br>
<br>
<br></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="tony19@gmail.com" photoname="Tony Trinh"
src="cid:part1.01080408.09090205@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
9:27 PM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><pre wrap="">See below...
On Fri, Jan 20, 2012 at 8:06 PM, Roger Spears <a class="moz-txt-link-rfc2396E" href="mailto:rspears@northweststate.edu"><rspears@northweststate.edu></a>wrote:
</pre><blockquote type="cite"><pre wrap="">I also tried adding the class to the encoder. That didn't work either.
Something else that's weird. I imported Tony's project to my Netbeans and
it stated it had reference issues. It could not find
logback-core-1.0.0.jar, logback-classic-1.0.0.jar and sl4j-api-1.6.4.jar.
I know I can resolve this, I'll just point them towards my versions of
those jar's. BUT, for giggles, I ran the project with the unresolved
reference issues and it displayed the same thing on the console:
19:57:35.609 [main] INFO helloworld.HelloWorld - hello world!
</pre></blockquote><pre wrap=""><!---->I just imported that project into another machine, updated the JAR
references (as they're not in the same location on the other machine), and
ran it. I see this:
run:
2012-01-20 21:10:50,277
FOOBAR [main] INFO helloworld.HelloWorld -
hello world!BUILD SUCCESSFUL (total time: 0 seconds)
</pre><blockquote type="cite"><pre wrap="">I'm not sure if that's a clue to anything or if that's the expected
behavior since I have those files in my classpath.
</pre></blockquote><pre wrap=""><!---->Try my exact steps to create that project:
1. Create a new Java project in Netbeans (or Eclipse...same steps here
work).
2. Create a class named "HelloWorld", and copy this code into it:
package helloworld;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class HelloWorld {
private static final Logger LOG = LoggerFactory.getLogger(HelloWorld.class);
public static void main(String[] args) {
LOG.info("hello world!");
}
}
3. Create a file named logback.xml in the src directory (do not put it
under src/helloworld or any other subdirectory). Copy the following into
the file:
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%date %n FOOBAR [%thread] %level %logger{35} - %n
%msg</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
</configuration>
*You can actually put logback.xml into any directory specified by the
run.classpath property in ${project.dir}/nbproject/project.properties. We
used src here only because it's quick and easy.*
4. Build and run the project.
</pre><pre wrap="">_______________________________________________
Logback-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a>
<a class="moz-txt-link-freetext" href="http://mailman.qos.ch/mailman/listinfo/logback-user">http://mailman.qos.ch/mailman/listinfo/logback-user</a></pre></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.01080408.09090205@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
8:06 PM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><div>I also tried adding the
class to the encoder. That didn't work either.<br><br>Something else
that's weird. I imported Tony's project to my Netbeans and it <br>stated
it had reference issues. It could not find logback-core-1.0.0.jar, <br>logback-classic-1.0.0.jar
and sl4j-api-1.6.4.jar. I know I can resolve this, <br>I'll just point
them towards my versions of those jar's. BUT, for giggles, I <br>ran
the project with the unresolved reference issues and it displayed the
same <br>thing on the console:<br><br>19:57:35.609 [main] INFO
helloworld.HelloWorld - hello world!<br><br>I'm not sure if that's a
clue to anything or if that's the expected behavior <br>since I have
those files in my classpath.<br><br>Thanks,<br>Roger<br><br>> Adam
Gordon <a class="moz-txt-link-rfc2396E" href="mailto:adam.n.gordon@gmail.com"><mailto:adam.n.gordon@gmail.com></a><br>> January 20, 2012
7:44 PM<br>> based on Tony's earlier response, it sounds like log
back still cannot find<br>> your XML file on the class path.<br>><br>>
--adam<br>><br>> On Jan 20, 2012, at 17:41, Roger Spears
<a class="moz-txt-link-rfc2396E" href="mailto:rspears@northweststate.edu"><rspears@northweststate.edu></a> wrote:<br>><br>> I'm curious,
when you run the attached project, what do you get for the<br>>
console output? Since it has FOOBAR in the pattern, I would have
expected<br>> 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>><br>> <compose-unknown-contact.jpg><br>> Tony
Trinh <a class="moz-txt-link-rfc2396E" href="mailto:tony19@gmail.com"><tony19@gmail.com></a><br>> January 20, 2012 1:34 PM<br>>
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<br>>
<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><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>><br>>
_______________________________________________<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><br>>
<compose-unknown-contact.jpg><br>> Roger Spears
<a class="moz-txt-link-rfc2396E" href="mailto:rspears@northweststate.edu"><rspears@northweststate.edu></a><br>> January 20, 2012 12:07 PM<br>>
Hello,<br>><br>> I'm running Netbeans 7.0.1 on a Mac Book Pro
with OS Lion. I'm currently<br>> 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<br>> location. I'm
able to run the basic logback HelloWorld example. Here's<br>> 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<br>>
logback.xml file. I'm starting out easy by just changing the pattern to<br>>
see if I can get it to work. When I run the project, I see the
following<br>> 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<br>> logback.xml in
the following locations just to see if I had it in the wrong<br>>
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>><br>><br>>
_______________________________________________<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><br>> Tony Trinh
<a class="moz-txt-link-rfc2396E" href="mailto:tony19@gmail.com"><mailto:tony19@gmail.com></a><br>> January 20, 2012 1:34 PM<br>>
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>><br>>
_______________________________________________<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><br>> Roger Spears
<a class="moz-txt-link-rfc2396E" href="mailto:rspears@northweststate.edu"><mailto:rspears@northweststate.edu></a><br>> January 20, 2012
12:07 PM<br>> Hello,<br>><br>> I'm running Netbeans 7.0.1 on a
Mac Book Pro with OS Lion. I'm currently <br>> 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 <br>>
location. I'm able to run the basic logback HelloWorld example. Here's
the <br>> 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 <br>>
logback.xml file. I'm starting out easy by just changing the pattern
to see <br>> if I can get it to work. When I run the project, I see
the following on the <br>> 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 <br>>
logback.xml in the following locations just to see if I had it in the
wrong <br>> 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></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>