Andrew Mercer
on this page

    logger (util-linux) sends a message to the system logger, useful for testing log routing or adding log lines from shell scripts.

    logger "deploy script finished"                       # tagged with your username, facility user.notice
    logger -t myapp -p user.info "starting nightly job"    # custom tag and facility.priority
    logger -p authpriv.crit "suspicious login attempt"
    logger -s "also print this to stderr"
    echo "line from a pipe" | logger -t mypipe
    logger --journald <<EOF                                 # write structured fields directly to journald
    MESSAGE=custom structured log line
    PRIORITY=6
    MYAPP_FIELD=value
    EOF
    

    Check where it landed:

    journalctl -t myapp --since "5 min ago"
    tail -f /var/log/messages | grep myapp        # traditional syslog path, if used
    

    If nothing shows up, the facility/priority combination may be filtered by rsyslog/journald configuration, or the traditional kernel log daemon (klogd on very old systems) is not running for kernel-facility messages. Related: journalctl for reading, cron for scheduled jobs that often pipe their output through logger.