هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
logger MESSAGE sends a message with facility user and priority notice. With -p FACILITY.PRIORITY and -t TAG you control where it goes and how it is marked. Use it to test rsyslog rules and to log what your scripts do. It can also send to a remote syslog server.
طريقة الكتابة
logger [OPTION]... [MESSAGE]الخيارات 24
الأكثر استخدامًا
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 10
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Write a simple message
logger "backup started" journalctl -n 1 Oct 25 11:05:12 server1 student[4410]: backup startedThe tag is your user name.
2With a tag and priority
logger -t backup -p user.err "backup failed: disk full"Easy to find with
journalctl -t backup -p err.3Test an rsyslog rule
logger -p local4.warning "test for backup.log" tail -1 /var/log/backup.logProves the rule works.
4Also show it on the screen
logger -s -t deploy "version 2.4 deployed" <13>Oct 25 11:06:01 deploy: version 2.4 deployed-s prints to stderr too.
5Log a whole file
logger -t import -f /var/tmp/import-report.txtOne log line per file line.
6Log from a script
logger -t myscript -p user.info "$(date +%F) cleaned $(find /var/tmp -mtime +7 | wc -l) files"Your script results in the central logs.
7Send to a remote syslog server
logger -n logserver.example.com -T -P 514 -t test "remote test"Check that the log server receives messages.
8Log the result of a command
dnf -y upgrade >/dev/null 2>&1 && logger -t patch "upgrade OK" || logger -t patch -p user.err "upgrade FAILED"Success or failure in the log.
9Pipe output into the log
df -h / | logger -t diskcheckEvery line becomes a log entry.
10Mark tests in security monitoring
logger -t soc-test "SIEM detection test 2026-10-25"Test that your SIEM gets and alerts on messages.
لا يوجد شيء يطابق هذا الفلتر.
رموز الخروج
0 :: Done. 1 :: Error.