<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">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>
<br>
<br>
Aleksandar<br>
<br>
<br>
On 24.04.2013. 10:40, David Roussel wrote:<br>
</div>
<blockquote
cite="mid:8B72B7F3-8991-4942-B3EB-2E3C0DC6F3D3@diroussel.xsmail.com"
type="cite">
<pre wrap="">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 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>
</blockquote>
<br>
</body>
</html>