[
https://issues.apache.org/jira/browse/LOG4J2-2567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16936528#comment-16936528
]
Neeraj commented on LOG4J2-2567:
--------------------------------
One workaround:
use "{color:#6a8759}useTlsMessageFormat{color}" = true, this has octet count
frame.
You will need to pass layout information yourself. Programmatically e.g
.addComponent(builder.newLayout({color:#6a8759}"Rfc5424Layout"{color})
.addAttribute({color:#6a8759}"useTlsMessageFormat"{color}{color:#cc7832},
{color}{color:#6a8759}"true"{color})
.addAttribute({color:#6a8759}"id"{color}{color:#cc7832},{color}{color:#6a8759}"App"{color})
.addAttribute({color:#6a8759}"mdcId"{color}{color:#cc7832},
{color}{color:#6a8759}"mdc"{color})
.addAttribute({color:#6a8759}"includeMDC"{color}{color:#cc7832},{color}{color:#6a8759}"true"{color})
.addAttribute({color:#6a8759}"facility"{color}{color:#cc7832},{color}{color:#6a8759}"LOCAL0"{color})
.addAttribute({color:#6a8759}"enterpriseNumber"{color}{color:#cc7832},{color}{color:#6a8759}"18060"{color})
.addAttribute({color:#6a8759}"useTlsMessageFormat"{color}{color:#cc7832},
{color}{color:#6a8759}"true"{color})
)
> syslog appender, tcp causes 'invalid frame header', connection dropped with
> syslog-ng server
> --------------------------------------------------------------------------------------------
>
> Key: LOG4J2-2567
> URL: https://issues.apache.org/jira/browse/LOG4J2-2567
> Project: Log4j 2
> Issue Type: Question
> Components: Appenders
> Affects Versions: 2.11.2
> Reporter: a b
> Priority: Major
>
> Hi.
> {code:xml}
> <Appenders>
> <Syslog appName="test" connectTimeoutMillis="3000" host="127.0.0.1"
> immediateFail="true" mdcId="syslog-mdcid" name="syslog" newLine="true"
> port="7601" protocol="TCP" reconnectionDelayMillis="3000"/>
> </Appenders>{code}
>
> using syslog-ng (3.19.1), here's what the server prints-out:
> {noformat}
> [2019-03-21T11:34:26.046972] Syslog connection accepted; fd='17',
> client='AF_INET(172.17.0.1:39432)', local='AF_INET(0.0.0.0:601)'
> [2019-03-21T11:34:26.066218] Invalid frame header; header=''
> [2019-03-21T11:34:26.066339] Syslog connection closed; fd='17',
> client='AF_INET(172.17.0.1:39432)', local='AF_INET(0.0.0.0:601)'
> {noformat}
> Using
> {noformat}
> logger -n 127.0.0.1 -P 7601 -T --octet-count test{noformat}
> works fine.
> How can I configure log4j2 to send a syslog message, over non-tls TCP, to
> syslog-ng correctly?
> Thanks!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)