<div dir="ltr"><div class="" itemprop="text">
<p>If you add the jar files to C:\Program Files\Java\jre7\lib\ext . and try to run the program like below:</p>

<ul>
<li>\logback>java Logback</li>
</ul>

<p>it wont see the logback.xml file in the source directory</p>

<p>when i deleted the </p>

<ul>
<li>logback-access-1.1.2.jar </li>
<li>logback-classic-1.1.2.jar</li>
<li>logback-core-1.1.2.jar</li>
<li>slf4j-api-1.7.6.jar</li>
</ul>

<p>files from C:\Program Files\Java\jre7\lib\ext, it went OK!</p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 14, 2014 at 10:38 AM,  <span dir="ltr"><<a href="mailto:logback-user-request@qos.ch" target="_blank">logback-user-request@qos.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send Logback-user mailing list submissions to<br>
        <a href="mailto:logback-user@qos.ch">logback-user@qos.ch</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:logback-user-request@qos.ch">logback-user-request@qos.ch</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:logback-user-owner@qos.ch">logback-user-owner@qos.ch</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Logback-user digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. unable to find logback.xml file in my simple project<br>
      (mohamad mohsen Taheri)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 14 Oct 2014 10:35:38 +0330<br>
From: mohamad mohsen Taheri <<a href="mailto:mohsen.taheri.1989@gmail.com">mohsen.taheri.1989@gmail.com</a>><br>
To: <a href="mailto:logback-user@qos.ch">logback-user@qos.ch</a><br>
Subject: [logback-user] unable to find logback.xml file in my simple<br>
        project<br>
Message-ID:<br>
        <CACKNU3jim9BNCogSqCn-VrzJBvmfFrOK4E=<a href="mailto:QeNNf0eCF3gyjvw@mail.gmail.com">QeNNf0eCF3gyjvw@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
I'm trying to use logback as my logger in my simple program but it does not<br>
work fine! I put logback/logback.xml and logback/Logback.java in the source<br>
directory logback and run through this command line<br>
<br>
   - \logback>java -cp .;%CLASSPATH% Logback<br>
<br>
which the %CLASSPATH% is an environment variable that has the path of .jar<br>
file that logback needs like:<br>
<br>
   - logback-access-1.1.2.jar<br>
   - logback-classic-1.1.2.jar<br>
   - logback-core-1.1.2.jar<br>
   - slf4j-api-1.7.6.jar<br>
<br>
This is my logback.xml file<br>
<br>
<configuration><br>
    <appender name="FILE"<br>
class="ch.qos.logback.core.rolling.RollingFileAppender"><br>
<br>
        <file>test.log</file><br>
<br>
        <rollingPolicy<br>
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"><br>
            <fileNamePattern>tests.%i.log</fileNamePattern><br>
            <minIndex>1</minIndex><br>
        </rollingPolicy><br>
<br>
        <triggeringPolicy<br>
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"><br>
            <maxFileSize>2MB</maxFileSize><br>
        </triggeringPolicy><br>
<br>
        <encoder><br>
            <pattern>%date %level [%thread] %logger{10} [%file:%line]<br>
%msg%n</pattern><br>
        </encoder><br>
<br>
    </appender><br>
<br>
    <root level="debug"><br>
        <appender-ref ref="FILE" /><br>
    </root></configuration><br>
<br>
and there is my simple program<br>
<br>
import org.slf4j.Logger;import org.slf4j.LoggerFactory;<br>
public class Logback{<br>
    private final static Logger logger = LoggerFactory.getLogger(Logback.class);<br>
<br>
    public static void main(String[] args){<br>
        for(int i=0;i<1000000;i++)<br>
            logger.debug("hello");<br>
    }}<br>
<br>
but unfortunately i just receive log in the console instead of test.log<br>
files. it seems the logger object just use the default configuration!!!<br>
<br>
If i set the -Dlogback.configurationFile=logback.xml variable as below, it<br>
works properly. but how to run without this variable?<br>
<br>
   - \logback>java -cp .;%CLASSPATH%<br>
   -Dlogback.configurationFile=logback.xml Logback<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mailman.qos.ch/pipermail/logback-user/attachments/20141014/b26d2329/attachment.html" target="_blank">http://mailman.qos.ch/pipermail/logback-user/attachments/20141014/b26d2329/attachment.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br>
<br>
------------------------------<br>
<br>
End of Logback-user Digest, Vol 37, Issue 6<br>
*******************************************<br>
</blockquote></div><br></div>