<div dir="ltr">That has more to do with your networking & firewall configuration then logback. Logback is probably blocking when it tries to establish the connection to <remote server ip>. <remote server ip> is neither granting nor denying the connection. <br>
<br>Try testing out the TCP connectivity to the remote logback server outside of logback (<i>telnet <remote server ip> 6000</i>) from the same machine you are experiencing this issue. If that doesn't work, logback can't be expected to work either and you'd need to work out the networking/firewall issues before worrying about logback.<br>
<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 24, 2013 at 6:51 AM, Aleksandar Stefanovic <span dir="ltr"><<a href="mailto:stefanovical@gmail.com" target="_blank">stefanovical@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hi David,<br>
<br>
I will explain my problem in more details. I am using logback
1.0.7 and slf4j 1.7.5. For building, I use Eclipse IDE, one simple
test program to log message and logback.xml as configuration file
for parameters. This is how logback.xml looks like.<br>
<br>
<?xml version="1.0" encoding="UTF-8"?><br>
<configuration><br>
<appender name="FILE"
class="ch.qos.logback.core.FileAppender"><br>
<file>myApp.log</file><br>
<encoder><br>
<pattern>%date [%thread] %level %logger{15}
%msg%n</pattern><br>
</encoder><br>
</appender><br>
<appender name="SOCKET"
class="ch.qos.logback.classic.net.SocketAppender"><br>
<remoteHost><font color="red">localhost</font></remoteHost><br>
<port>6000</port><br>
<reconnectionDelay>10000</reconnectionDelay><br>
<includeCallerData>true</includeCallerData><br>
</appender><br>
<root level="debug"><br>
<appender-ref ref="FILE" /><br>
<appender-ref ref="SOCKET" /><br>
</root><br>
</configuration><br>
<br>
For testing purpose I use
ch.qos.logback.classic.net.SimpleSocketServer, passing 2 arguments
as shown on site ie. <i>java
ch.qos.logback.classic.net.SimpleSocketServer 6000
src/main/java/chapters/appenders/socket/server1.xml</i>. When <font color="red">localhost</font> is in the place, the messages are
sent without problems to server. Also, tested with IP address of
another computer in my LAN where I started SimpleSocketServer on
that address and also messages are sent without problems. So, the
actual problem is when there is some public IP address (i want to
send to remote office's server) in remoteHost, building simple
stop with executing in Eclipse.<br>
By setting <i>debug="true"</i> attribute of <i>configuration</i>
tag in xml and when there is localhost as remoteHost address I
got this:<br>
...<br>
12:28:41,172 |-INFO in
ch.qos.logback.core.joran.action.AppenderAction - About to
instantiate appender of type
[ch.qos.logback.classic.net.SocketAppender]<br>
12:28:41,176 |-INFO in
ch.qos.logback.core.joran.action.AppenderAction - Naming appender
as [SOCKET]<br>
12:28:41,197 |-INFO in
ch.qos.logback.classic.net.SocketAppender[SOCKET] - Starting a new
connector thread.<br>
12:28:41,199 |-INFO in
ch.qos.logback.classic.net.SocketAppender[SOCKET] - Could not
connect to remote logback server at [localhost]. We will try again
later. java.net.ConnectException: Connection refused<br>
at java.net.ConnectException: Connection refused<br>
...<br>
<br>
which basically means waiting for server to be up again and will
try later to send log message, and running application continues
with executing anyway.<br>
<br>
But if I put IP address of remote server, process paused here:<br>
...<br>
12:41:35,234 |-INFO in
ch.qos.logback.core.joran.action.AppenderAction - About to
instantiate appender of type
[ch.qos.logback.classic.net.SocketAppender]<br>
12:41:35,239 |-INFO in
ch.qos.logback.core.joran.action.AppenderAction - Naming appender
as [SOCKET]<br>
<br>
What caused that to happens? Is possibly at all to send socket
messages to remote server IP address and how I can achieve it? <br><span class="HOEnZb"><font color="#888888">
<br>
<br>
Aleksandar</font></span><div><div class="h5"><br>
<br>
<br>
On <a href="tel:24.04.2013.%2010" value="+12404201310" target="_blank">24.04.2013. 10</a>:40, David Roussel wrote:<br>
</div></div></div><div><div class="h5">
<blockquote type="cite">
<pre>Hi,
It's not clear what your question is. Is something not working? Are you asking what is the best way to configure it?
What version of logback are you using. And what does your logback.xml look like?
David
_______________________________________________
Logback-user mailing list
<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a>
</pre>
</blockquote>
<br>
</div></div></div>
<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></blockquote></div><br><br clear="all"><br>-- <br>Ross Sargant<br>Software Engineer<br>
p: 954-796-2592<br>email: <a href="mailto:rsargant@tvrc.com" target="_blank">rsargant@tvrc.com</a><br><br>TVR Communications LLC<br>541 S. State Road 7,Suite 5,Margate, Florida,33068<br><br><a href="http://www.tvrc.com" target="_blank">http://www.tvrc.com</a><br>
</div>