Write in rsyslog with docker not found
I’m trying to write via console in a rsyslog with TCP 514 port, but the command doesn’t write in var/log/messages .
And this is my rsyslog.conf
# provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
$ActionFileDefaultTemplate RSYSLOG_SyslogProtocol23Format
# Filter duplicated messages
$RepeatedMsgReduction on
# Set the default permissions for all log files.
$FileOwner syslog
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$PrivDropToUser syslog
$PrivDropToGroup syslog
#
*.*
/var/log/traditionalfile.log;
template(name="RSYSLOG_SyslogProtocol23Format" type="string"
string="<%PRI%>1 %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% %msg%n"
)
# Where to place spool and state files
$WorkDirectory /var/spool/rsyslog
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none /var/log/messages
# The authpriv file has restricted access.
authpriv.* /var/log/secure
# Log all the mail messages in one place.
mail.* /var/log/maillog
#For a start, use this simplified approach.
*.* /var/log/messages
And this is my dockerfile
FROM picoded/ubuntu-openjdk-8-jdk:14.04
RUN apt-get install rsyslog -y
COPY docker-syslog/rsyslog.conf etc/rsyslog.conf
# sudo service rsyslog restart -> i run this command manually
If I run rsyslogd -N1
rsyslogd: version 7.4.4, config validation run (level 1), master config /etc/rsyslog.conf
rsyslogd: End of config validation run. Bye.
And this is the content in var/log/messages
<46>1 2020-10-28T22:27:02.607988+00:00 4089ab4ec9ab rsyslogd - - - [origin software="rsyslogd" swVersion="7.4.4" x-pid="389" x-info="http://www.rsyslog.com"] start
<46>1 2020-10-28T22:27:02.607809+00:00 4089ab4ec9ab rsyslogd - - - rsyslogd's groupid changed to 104
<46>1 2020-10-28T22:27:02.607910+00:00 4089ab4ec9ab rsyslogd - - - rsyslogd's userid changed to 101
With this command i write in rsyslog :
logger -p local0.warn -d -n 127.0.0.1 "test message to catchall" -u /ignore/socket
All ideas are welcome.
Source: Docker Questions