Trailing white space is removed in /var/log/messages

Solution Verified - Updated -

Issue

Trailing white space is removed in /var/log/messages.

Steps to Reproduce:
1. Use the logger command with a trailing white space:

[root@localhost ~]# logger "TEST "

Actual results:

[root@localhost ~]# cat /var/log/debug.log 
Debug line with all properties:
FROMHOST: 'localhost', fromhost-ip: '127.0.0.1', HOSTNAME: 'localhost', PRI: 13,
syslogtag 'root:', programname: 'root', APP-NAME: 'root', PROCID: '-', MSGID: '-',
TIMESTAMP: 'Jan  2 11:30:18', STRUCTURED-DATA: '-',
msg: 'TEST'
escaped msg: 'TEST'
inputname: imjournal rawmsg: 'TEST'

The trailing white space is removed as above.

Environment

  • Red Hat Enterprise Linux 7
  • systemd

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content