Introduction
This article describe how to activate the application logs in order to have dedicated application log files instead of merging them into system journal.
Description
By default, on CentOS/RedHat 7, the SES logs are managed with journald. Some customers may want to manage deidcated application log files (e.g into /var/log/systran) then use logrotate mechanisms or stuffs like that.
Implementation
Create a file /etc/rsyslog.d/systran.conf with following rules
if $programname == 'systran-corpus-manager2' then /var/log/systran/systran-corpus-manager2.log
if $programname == 'systran-corpus-manager2' then ~
if $programname == 'systran-dct-indexer' then then /var/log/systran/systran-dct-indexer.log
if $programname == 'systran-dct-indexer' then ~
if $programname == 'systran-gdict' then then /var/log/systran/systran-gdict.log
if $programname == 'systran-gdict' then ~
if $programname == 'systran-lookup' then then /var/log/systran/systran-lookup.log
if $programname == 'systran-lookup' then ~
if $programname == 'systran-routing' then then /var/log/systran/systran-routing.log
if $programname == 'systran-routing' then ~
if $programname == 'systran-ses-console' then then /var/log/systran/systran-ses-console.log
if $programname == 'systran-ses-console' then ~
if $programname == 'systran-ses-file-translation-consumer' then then /var/log/systran/systran-ses-file-translation-consumer.log
if $programname == 'systran-ses-file-translation-consumer' then ~
if $programname == 'systran-ses-gateway' then then /var/log/systran/systran-ses-gateway.log
if $programname == 'systran-ses-gateway' then ~
if $programname == 'systran-ses-poller' then then /var/log/systran/systran-ses-poller.log
if $programname == 'systran-ses-poller' then ~
if $programname == 'systran-tm-indexer' then then /var/log/systran/systran-tm-indexer.log
if $programname == 'systran-tm-indexer' then ~
if $programname == 'systran-translation-dispatcher' then then /var/log/systran/systran-translation-dispatcher.log
if $programname == 'systran-translation-dispatcher' then ~
if $programname == 'systran-translation-resource-monitor' then then /var/log/systran/systran-translation-resource-monitor.log
if $programname == 'systran-translation-resource-monitor' then ~
if $programname == 'systran-trs-console' then then /var/log/systran/systran-trs-console.log
if $programname == 'systran-trs-console' then ~
if $programname == 'systran-trs-poller' then then /var/log/systran/systran-trs-poller.log
if $programname == 'systran-trs-poller' then ~
Check in /etc/rsyslog.conf if following directives are set
$ModLoad imjournal # provides access to the systemd journal
$IMJournalStateFile imjournal.state
Then restart the rsyslog service
systemctl restart rsyslog
Then check if log files are presents in /var/log/systran
If rsyslog doesn't start, try to update /etc/rsyslog.d/systran.conf with following rules
if $programname == 'systran-corpus-manager2' then /var/log/systran/systran-corpus-manager2.log
if $programname == 'systran-corpus-manager2' then stop
if $programname == 'systran-dct-indexer' then then /var/log/systran/systran-dct-indexer.log
if $programname == 'systran-dct-indexer' then stop
if $programname == 'systran-gdict' then then /var/log/systran/systran-gdict.log
if $programname == 'systran-gdict' then stop
if $programname == 'systran-lookup' then then /var/log/systran/systran-lookup.log
if $programname == 'systran-lookup' then stop
if $programname == 'systran-routing' then then /var/log/systran/systran-routing.log
if $programname == 'systran-routing' then stop
if $programname == 'systran-ses-console' then then /var/log/systran/systran-ses-console.log
if $programname == 'systran-ses-console' then stop
if $programname == 'systran-ses-file-translation-consumer' then then /var/log/systran/systran-ses-file-translation-consumer.log
if $programname == 'systran-ses-file-translation-consumer' then stop
if $programname == 'systran-ses-gateway' then then /var/log/systran/systran-ses-gateway.log
if $programname == 'systran-ses-gateway' then stop
if $programname == 'systran-ses-poller' then then /var/log/systran/systran-ses-poller.log
if $programname == 'systran-ses-poller' then stop
if $programname == 'systran-tm-indexer' then then /var/log/systran/systran-tm-indexer.log
if $programname == 'systran-tm-indexer' then stop
if $programname == 'systran-translation-dispatcher' then then /var/log/systran/systran-translation-dispatcher.log
if $programname == 'systran-translation-dispatcher' then stop
if $programname == 'systran-translation-resource-monitor' then then /var/log/systran/systran-translation-resource-monitor.log
if $programname == 'systran-translation-resource-monitor' then stop
if $programname == 'systran-trs-console' then then /var/log/systran/systran-trs-console.log
if $programname == 'systran-trs-console' then stop
if $programname == 'systran-trs-poller' then then /var/log/systran/systran-trs-poller.log
if $programname == 'systran-trs-poller' then stop