Question
Logging to centralized server was configured according to documentation, but all logs are stored in one file. Is it possible to store logs in separate files like in PBA-E application server?
Answer
Rsyslog(which is shipped with Centos 6 by default) has mechanism called RainerScript for filtering of incoming message. To configure logs to be stored in separate files:
- Configure system logging according to documentation.
Add the following line to /etc/rsyslog.conf on log server for each container:
if $syslogfacility-text == 'local7' and $programname == '<container_name_in_capital_letters>' then /var/log/<container_name>.log
Restart rsyslog:
/etc/init.d/rsyslog restart
Now all log entries for container you specified will be written to file you specified.
For example for BM container the line will look the following way:
if $syslogfacility-text == 'local7' and $programname == 'BM' then /var/log/BM.log
Note: for amt/atm container please specify _amt_service_
for programname parameter.