1logger(1B) SunOS/BSD Compatibility Package Commands logger(1B)
2
3
4
6 logger - add entries to the system log
7
9 /usr/ucb/logger [-f filename] [-i] [-p priority] [-t tag] mm
10 [message]...
11
12
14 The logger utility provides a method for adding one-line entries to the
15 system log file from the command line. One or more message arguments
16 can be given on the command line, in which case each is logged immedi‐
17 ately. If message is unspecified, either the file indicated with -f or
18 the standard input is added to the log. Otherwise, a filename can be
19 specified, in which case each line in the file is logged. If neither is
20 specified, logger reads and logs messages on a line-by-line basis from
21 the standard input.
22
24 The following options are supported:
25
26 -i Log the process ID of the logger process with each line.
27
28
29 -f filename Use the contents of filename as the message to log.
30
31
32 -p priority Enter the message with the specified priority. The mes‐
33 sage priority can be specified numerically, or as a
34 facility.level pair. For example, `-p local3.info'
35 assigns the message priority to the info level in the
36 local3 facility. The default priority is user.notice.
37
38
39 -t tag Mark each line added to the log with the specified tag.
40
41
43 Example 1 Logging a message
44
45
46 The command:
47
48
49 example% logger System rebooted
50
51
52
53
54 will log the message `System rebooted' to the facility at priority
55 notice to be treated by syslogd as other messages to the facility
56 notice are.
57
58
59 Example 2 Logging messages from a file
60
61
62 The command:
63
64
65 example% logger -p local0.notice -t HOSTIDM -f /dev/idmc
66
67
68
69
70 will read from the file /dev/idmc and will log each line in that file
71 as a message with the tag `HOSTIDM' at priority notice to be treated by
72 syslogd as other messages to the facility local0 are.
73
74
76 See attributes(5) for descriptions of the following attributes:
77
78
79
80
81 ┌─────────────────────────────┬─────────────────────────────┐
82 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
83 ├─────────────────────────────┼─────────────────────────────┤
84 │Availability │SUNWscpu │
85 └─────────────────────────────┴─────────────────────────────┘
86
88 syslogd(1M), syslog(3C), attributes(5)
89
90
91
92SunOS 5.11 14 Sep 1992 logger(1B)