vlog: Move log level definitions from source code to user documentation.
[sliver-openvswitch.git] / utilities / ovs-appctl.8.in
1 .\" -*- nroff -*-
2 .de IQ
3 .  br
4 .  ns
5 .  IP "\\$1"
6 ..
7 .TH ovs\-appctl 8 "November 2009" "Open vSwitch" "Open vSwitch Manual"
8 .ds PN ovs\-appctl
9 .
10 .SH NAME
11 ovs\-appctl \- utility for configuring running Open vSwitch daemons
12 .
13 .SH SYNOPSIS
14 \fBovs\-appctl\fR [\fB\-\-target=\fItarget\fR | \fB\-t\fR \fItarget\fR]
15 \fIcommand \fR[\fIarg\fR...]
16 .br
17 \fBovs\-appctl\fR \-\-help
18 .br
19 \fBovs\-appctl\fR \-\-version
20 .SH DESCRIPTION
21 Open vSwitch daemons accept certain commands at runtime to control
22 their behavior and query their settings.  Every daemon accepts the
23 commands for querying and adjusting its logging settings documented
24 under \fBLOGGING COMMANDS\fR below, and \fBovs\-vswitchd\fR in
25 particular accepts a number of additional commands documented in
26 \fBovs\-vswitchd\fR(8).
27 .PP
28 The \fBovs\-appctl\fR program provides a simple way to invoke these
29 commands.  The command to be sent is specified on \fBovs\-appctl\fR's
30 command line as non-option arguments.  \fBovs\-appctl\fR sends the
31 command and prints the daemon's response on standard output.
32 .PP
33 In normal use only a single option is accepted:
34 .IP "\fB\-t \fItarget\fR"
35 .IQ "\fB\-\-target=\fItarget\fR"
36 Tells \fBovs\-appctl\fR which daemon to contact.
37 .IP
38 If \fItarget\fR begins with \fB/\fR it must name a Unix domain socket
39 on which an Open vSwitch daemon is listening for control channel
40 connections.  By default, each daemon listens on a Unix domain socket
41 named \fB@RUNDIR@/\fIprogram\fB.\fIpid\fB.ctl\fR, where \fIprogram\fR
42 is the program's name and \fIpid\fR is its process ID.  For example,
43 if \fBovs\-vswitchd\fR has PID 123, it would listen on
44 \fB@RUNDIR@/ovs\-vswitchd.123.ctl\fR.
45 .IP
46 Otherwise, \fBovs\-appctl\fR looks for a pidfile, that is, a file
47 whose contents are the process ID of a running process as a decimal
48 number, named \fB@RUNDIR@/\fItarget\fB.pid\fR.  (The \fB\-\-pidfile\fR
49 option makes an Open vSwitch daemon create a pidfile.)
50 \fBovs\-appctl\fR reads the pidfile, then looks for a Unix socket
51 named \fB@RUNDIR@/\fItarget\fB.\fIpid\fB.ctl\fR, where \fIpid\fR is
52 replaced by the process ID read from the pidfile, and uses that file
53 as if it had been specified directly as the target.
54 .IP
55 The default target is \fBovs\-vswitchd\fR.
56 .
57 .SH LOGGING COMMANDS
58 .
59 .PP
60 Open vSwitch has several log levels.  The highest-severity log level
61 is:
62 .
63 .IP "\fBOFF\fR"
64 No message is ever logged at this level, so setting a logging
65 facility's log level to \fBOFF\fR disables logging to that facility.
66 .
67 .PP
68 The following log levels, in order of descending severity, are enabled
69 by default:
70 .
71 .IP "\fBEMER\f"
72 A major failure forced a process to abort.
73 .IP "\fBERR\fR"
74 A high-level operation or a subsystem failed.  Attention is
75 warranted.
76 .IP "\fBWARN\fR"
77 A low-level operation failed, but higher-level subsystems may be able
78 to recover.
79 .IP "\fBINFO\fR"
80 Information that may be useful in retrospect when investigating
81 a problem.
82 .IP "\fBDBG\fR"
83 Information useful only to someone with intricate knowledge of the
84 system, or that would commonly cause too-voluminous log output.  Log
85 messages at this level are not logged by default.
86 .
87 .PP
88 Every Open vSwitch daemon supports the following commands for
89 examining and adjusting log levels.
90 .IP "\fBvlog/list\fR"
91 Lists the known logging modules and their current levels.
92 .
93 .IP "\fBvlog/set\fR \fImodule\fR[\fB:\fIfacility\fR[\fB:\fIlevel\fR]]"
94 Sets the logging level for \fImodule\fR in \fIfacility\fR to
95 \fIlevel\fR.  The \fImodule\fR may be any valid module name (as
96 displayed by the \fB\-\-list\fR option) or the special name \fBANY\fR to
97 set the logging levels for all modules.  The \fIfacility\fR may be
98 \fBsyslog\fR or \fBconsole\fR to set the levels for logging to the
99 system log or to the console, respectively, or \fBANY\fR to set the
100 logging levels for both facilities.  If it is omitted,
101 \fIfacility\fR defaults to \fBANY\fR.  The \fIlevel\fR must be one of
102 \fBoff\fR, \fBemer\fR, \fBerr\fR, \fBwarn\fR, \fBinfo\fR, or
103 \fBdbg\fR, designating the
104 minimum severity of a message for it to be logged.  If it is omitted,
105 \fIlevel\fR defaults to \fBdbg\fR.
106 .
107 .IP "\fBvlog/set PATTERN:\fIfacility\fB:\fIpattern\fR"
108 Sets the log pattern for \fIfacility\fR to \fIpattern\fR.  Each time a
109 message is logged to \fIfacility\fR, \fIpattern\fR determines the
110 message's formatting.  Most characters in \fIpattern\fR are copied
111 literally to the log, but special escapes beginning with \fB%\fR are
112 expanded as follows:
113 .
114 .RS
115 .IP \fB%A\fR
116 The name of the application logging the message, e.g. \fBovs\-vswitchd\fR.
117 .
118 .IP \fB%c\fR
119 The name of the module (as shown by \fBovs\-appctl \-\-list\fR) logging
120 the message.
121 .
122 .IP \fB%d\fR
123 The current date and time in ISO 8601 format (YYYY\-MM\-DD HH:MM:SS).
124 .
125 .IP \fB%d{\fIformat\fB}\fR
126 The current date and time in the specified \fIformat\fR, which takes
127 the same format as the \fItemplate\fR argument to \fBstrftime\fR(3).
128 .
129 .IP \fB%m\fR
130 The message being logged.
131 .
132 .IP \fB%N\fR
133 A serial number for this message within this run of the program, as a
134 decimal number.  The first message a program logs has serial number 1,
135 the second one has serial number 2, and so on.
136 .
137 .IP \fB%n\fR
138 A new-line.
139 .
140 .IP \fB%p\fR
141 The level at which the message is logged, e.g. \fBDBG\fR.
142 .
143 .IP \fB%P\fR
144 The program's process ID (pid), as a decimal number.
145 .
146 .IP \fB%r\fR
147 The number of milliseconds elapsed from the start of the application
148 to the time the message was logged.
149 .
150 .IP \fB%%\fR
151 A literal \fB%\fR.
152 .RE
153 .
154 .IP
155 A few options may appear between the \fB%\fR and the format specifier
156 character, in this order:
157 .
158 .RS
159 .IP \fB\-\fR
160 Left justify the escape's expansion within its field width.  Right
161 justification is the default.
162 .
163 .IP \fB0\fR
164 Pad the field to the field width with \fB0\fRs.  Padding with spaces
165 is the default.
166 .
167 .IP \fIwidth\fR
168 A number specifies the minimum field width.  If the escape expands to
169 fewer characters than \fIwidth\fR then it is padded to fill the field
170 width.  (A field wider than \fIwidth\fR is not truncated to fit.)
171 .RE
172 .
173 .IP
174 The default pattern for console output is \fB%d{%b %d
175 %H:%M:%S}|%05N|%c|%p|%m\fR; for syslog output, \fB%05N|%c|%p|%m\fR.
176 .
177 .IP "\fBvlog/reopen\fR"
178 Causes the daemon to close and reopen its log file.  (This
179 is useful after rotating log files, to cause a new log file to be
180 used.)
181 .IP
182 This has no effect if the target application was not invoked with the
183 \fB\-\-log\-file\fR option.
184 .
185 .SH OPTIONS
186 .
187 .so lib/common.man
188 .
189 .SH BUGS
190 .
191 The protocol used to speak to Open vSwitch daemons does not contain a
192 quoting mechanism, so command arguments should not generally contain
193 white space.
194 .
195 .SH "SEE ALSO"
196 .
197 \fBovs\-appctl\fR can control the following daemons:
198 .BR ovs\-vswitchd (8),
199 .BR ovs\-controller (8),
200 .BR ovs\-brcompatd (8).