Директивы Apache 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 Директива ErrorLogFormat RU EN
#Simple example ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M" Specifying It can happen that some format string items do not produce output. For
example, the Referer header is only present if the log message is
associated to a request and the log message happens at a time when the
Referer header has already been read from the client. If no output is
produced, the default behavior is to delete everything from the preceding
space character to the next space character. This means the log line is
implicitly divided into fields on non-whitespace to whitespace transitions.
If a format string item does not produce output, the whole field is
omitted. For example, if the remote address The above behavior can be changed by adding modifiers to the format
string item. A A number as modifier can be used to assign a log severity level to a format item. The item will only be logged if the severity of the log message is not higher than the specified log severity level. The number can range from 1 (alert) over 4 (warn) and 7 (debug) to 15 (trace8). For example, here's what would happen if you added modifiers to
the
Some format string items accept additional parameters in braces.
The log ID format #Example (default format for threaded MPMs) ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i" This would result in error messages such as: Notice that, as discussed above, some fields are omitted entirely because they are not defined. #Example (similar to the 2.2.x format) ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i" #Advanced example with request/connection log IDs ErrorLogFormat "[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M" ErrorLogFormat request "[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T" ErrorLogFormat request "[%{uc}t] [R:%L] UA:'%+{User-Agent}i'" ErrorLogFormat request "[%{uc}t] [R:%L] Referer:'%+{Referer}i'" ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A" See also
RU EN |
![]() |