[ 
https://issues.apache.org/jira/browse/LOG4J2-1707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Gregory updated LOG4J2-1707:
---------------------------------
    Description: 
Allow any TCP {{Socket}} Appender to set socket options.

At the lowest level, this means that if configured the following 
{{java.net.Socket}} options are called:

- java.net.Socket.setKeepAlive(boolean)
- java.net.Socket.setOOBInline(boolean)
- java.net.Socket.setPerformancePreferences(int, int, int)
- java.net.Socket.setReceiveBufferSize(int)
- java.net.Socket.setReuseAddress(boolean)
- java.net.Socket.setSendBufferSize(int)
- java.net.Socket.setSoLinger(boolean, int)
- java.net.Socket.setSoTimeout(int)
- java.net.Socket.setTcpNoDelay(boolean)
- java.net.Socket.setTrafficClass(int)

This will done through a new {{SocketOptions}} XML element (same idea for JSON 
and YAML).

Configuration example:

{code:xml}
<Configuration status="OFF" name="MyApp">
  <Appenders>
    <Socket name="socket" host="localhost" 
port="${sys:SocketAppenderSocketOptionsTest.port}" protocol="TCP" 
ignoreExceptions="false">
      <SocketOptions keepAlive="false" oobInline="false" 
receiveBufferSize="10000" reuseAddress="false"
        rfc1349TrafficClass="IPTOS_LOWCOST" sendBufferSize="8000" 
soLinger="12345" soTimeout="54321" tcpNoDelay="false">
        <SocketPerformancePreferences bandwidth="100" connectionTime="100" 
latency="100" />
      </SocketOptions>
    </Socket>
  </Appenders>
  <Loggers>
    <Root level="debug">
      <AppenderRef ref="socket" />
    </Root>
  </Loggers>
</Configuration>
{code}

Another ticket will follow for SSL and Syslog.

  was:
Allow any TCP {{Socket}} Appender to set socket options.

At the lowest level, this means that if configured the following 
{{java.net.Socket}} options are called:

- java.net.Socket.setKeepAlive(boolean)
- java.net.Socket.setOOBInline(boolean)
- java.net.Socket.setPerformancePreferences(int, int, int)
- java.net.Socket.setReceiveBufferSize(int)
- java.net.Socket.setReuseAddress(boolean)
- java.net.Socket.setSendBufferSize(int)
- java.net.Socket.setSoLinger(boolean, int)
- java.net.Socket.setSoTimeout(int)
- java.net.Socket.setTcpNoDelay(boolean)
- java.net.Socket.setTrafficClass(int)

This will done through a new {{SocketOptions}} XML element (same idea for JSON 
and YAML).

Another ticket will follow for SSL and Syslog.


> Allow TCP Socket Appender to set socket options
> -----------------------------------------------
>
>                 Key: LOG4J2-1707
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1707
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Gary Gregory
>            Assignee: Gary Gregory
>             Fix For: 2.8
>
>
> Allow any TCP {{Socket}} Appender to set socket options.
> At the lowest level, this means that if configured the following 
> {{java.net.Socket}} options are called:
> - java.net.Socket.setKeepAlive(boolean)
> - java.net.Socket.setOOBInline(boolean)
> - java.net.Socket.setPerformancePreferences(int, int, int)
> - java.net.Socket.setReceiveBufferSize(int)
> - java.net.Socket.setReuseAddress(boolean)
> - java.net.Socket.setSendBufferSize(int)
> - java.net.Socket.setSoLinger(boolean, int)
> - java.net.Socket.setSoTimeout(int)
> - java.net.Socket.setTcpNoDelay(boolean)
> - java.net.Socket.setTrafficClass(int)
> This will done through a new {{SocketOptions}} XML element (same idea for 
> JSON and YAML).
> Configuration example:
> {code:xml}
> <Configuration status="OFF" name="MyApp">
>   <Appenders>
>     <Socket name="socket" host="localhost" 
> port="${sys:SocketAppenderSocketOptionsTest.port}" protocol="TCP" 
> ignoreExceptions="false">
>       <SocketOptions keepAlive="false" oobInline="false" 
> receiveBufferSize="10000" reuseAddress="false"
>         rfc1349TrafficClass="IPTOS_LOWCOST" sendBufferSize="8000" 
> soLinger="12345" soTimeout="54321" tcpNoDelay="false">
>         <SocketPerformancePreferences bandwidth="100" connectionTime="100" 
> latency="100" />
>       </SocketOptions>
>     </Socket>
>   </Appenders>
>   <Loggers>
>     <Root level="debug">
>       <AppenderRef ref="socket" />
>     </Root>
>   </Loggers>
> </Configuration>
> {code}
> Another ticket will follow for SSL and Syslog.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to