File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/main/java/com/cloudbees/syslog/sender Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,9 @@ public class TcpSyslogMessageSender extends AbstractSyslogMessageSender {
7676 */
7777 protected final AtomicInteger trySendErrorCounter = new AtomicInteger ();
7878
79+ // use the CR LF non transparent framing as described in "3.4.2. Non-Transparent-Framing"
80+ private String postfix = "\r \n " ;
81+
7982 @ Override
8083 public synchronized void sendMessage (@ Nonnull SyslogMessage message ) throws IOException {
8184 sendCounter .incrementAndGet ();
@@ -90,8 +93,7 @@ public synchronized void sendMessage(@Nonnull SyslogMessage message) throws IOEx
9093 }
9194 ensureSyslogServerConnection ();
9295 message .toSyslogMessage (messageFormat , writer );
93- // use the CR LF non transparent framing as described in "3.4.2. Non-Transparent-Framing"
94- writer .write ("\r \n " );
96+ writer .write (postfix );
9597 writer .flush ();
9698 return ;
9799 } catch (IOException e ) {
@@ -240,6 +242,10 @@ public void setMaxRetryCount(int maxRetryCount) {
240242 this .maxRetryCount = maxRetryCount ;
241243 }
242244
245+ public void setPostfix (String postfix ) {
246+ this .postfix = postfix ;
247+ }
248+
243249 @ Override
244250 public String toString () {
245251 return getClass ().getName () + "{" +
You can’t perform that action at this time.
0 commit comments