Section: User Commands (1)
Updated: April 2013
If the prefix contains no facility, the facility defaults to what is specified by the -p option. Similarly, if no prefix is provided, the line is logged using the -p priority.
This option doesn't affect a command-line message.
$ printf "%s\n%s\n%s\n" MESSAGE_ID=86184c3b1aa444f58ebe7b30fec1438b DOGS=bark "CARAVAN=goes on" | logger --journald $ logger --journald=entry.txtNotice that --journald will ignore values of other options, such as priority. If priority is needed it must be within input, and use PRIORITY field. The simple execution of journalctl will display MESSAGE field. Use journalctl --output json-pretty to see rest of the fields.:
The logger utility exits 0 on success, and >0 if an error occurs.
Valid facility names are: auth, authpriv (for security information of a sensitive nature), cron, daemon, ftp, kern (can't be generated from user process), lpr, mail, news, security (deprecated synonym for auth), syslog, user, uucp, and local0 to local7, inclusive.
Valid level names are: alert, crit, debug, emerg, err, error (deprecated synonym for err), info, notice, panic (deprecated synonym for emerg), warning, warn (deprecated synonym for warning). For the priority order and intended purposes of these levels, see syslog?(3).
logger System rebooted
logger -p local0.notice -t HOSTIDM -f /dev/idmc
The logger command is part of the util-linux package and is available from Linux Kernel Archive
Tutoriais de Tecnologia Web