Skip to main content

Rsyslog

整合特定應用程式

情境一: 寫入日誌檔

應用程式透過 rsyslog 協定寫入訊息,系統輸出特定日誌檔。

/etc/rsyslog.d/myapp.conf

# Save db2audit log to db2audit
# Test command:
# logger -t db2audit -p user.info "Hello, This is Test Message"
if $programname == 'db2audit' then action(type="omfile" file="/var/log/db2audit")

 

情境二: 讀取日誌檔