Mercurial > hg > nginx
annotate docs/xsls/changes.xsls @ 9299:2706b60dc225 default tip
Core: error logging rate limiting.
With this change, error logging to files can be rate-limited with
the "rate=" parameter. The parameter specifies allowed log messages
rate to a particular file (per worker), in messages per second (m/s).
By default, "rate=1000m/s" is used.
Rate limiting is implemented using the "leaky bucket" method, similarly
to the limit_req module.
Maximum burst size is set to the number of log messages per second
for each severity level, so "error" messages are logged even if the
rate limit is hit by "info" messages (but not vice versa). When the
limit is reached for a particular level, the "too many log messages,
limiting" message is logged at this level.
If debug logging is enabled, either for the particular log file or for
the particular connection, rate limiting is not used.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 25 Jun 2024 22:58:56 +0300 |
parents | e79c7521aaf4 |
children |
rev | line source |
---|---|
450 | 1 X:stylesheet { |
2 | |
4028
76bc29f06168
CHANGES conversion from KOI8-R to UTF-8.
Igor Sysoev <igor@sysoev.ru>
parents:
4025
diff
changeset
|
3 X:output method="text"; |
450 | 4 |
5 X:param lang="'en'"; | |
6 X:param configuration="'../xml/change_log_conf.xml'"; | |
7 | |
8 X:var conf = "document($configuration)/configuration"; | |
9 X:var start = "$conf/start"; | |
10 X:var indent = "$conf/indent"; | |
11 X:var max = "$conf/length"; | |
12 X:var br = {<br>} | |
13 | |
14 | |
15 X:template = "/" { !! "change_log"; } | |
9215
e79c7521aaf4
Free nginx: support for sections in CHANGES.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6914
diff
changeset
|
16 X:template = "change_log" { !! "section"; } |
e79c7521aaf4
Free nginx: support for sections in CHANGES.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6914
diff
changeset
|
17 X:template = "section" { !! "changes"; } |
450 | 18 |
19 | |
20 X:template = "changes" { | |
21 X:text { } | |
22 | |
23 !{substring(concat($conf/changes[@lang=$lang]/title, | |
9215
e79c7521aaf4
Free nginx: support for sections in CHANGES.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6914
diff
changeset
|
24 ../@title, |
450 | 25 ' ', @ver, |
26 ' '), | |
27 1, $conf/changes[@lang=$lang]/length)} | |
28 | |
6914
529f10f7757c
Docs: changes.xml dates converted to ISO 8601 format.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4028
diff
changeset
|
29 X:if "$lang='ru'" { |
529f10f7757c
Docs: changes.xml dates converted to ISO 8601 format.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4028
diff
changeset
|
30 !{substring(@date, 9, 2)} |
529f10f7757c
Docs: changes.xml dates converted to ISO 8601 format.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4028
diff
changeset
|
31 X:text {.} |
529f10f7757c
Docs: changes.xml dates converted to ISO 8601 format.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4028
diff
changeset
|
32 !{substring(@date, 6, 2)} |
529f10f7757c
Docs: changes.xml dates converted to ISO 8601 format.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4028
diff
changeset
|
33 X:text {.} |
529f10f7757c
Docs: changes.xml dates converted to ISO 8601 format.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4028
diff
changeset
|
34 !{substring(@date, 1, 4)} |
529f10f7757c
Docs: changes.xml dates converted to ISO 8601 format.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4028
diff
changeset
|
35 } |
450 | 36 |
37 X:if "$lang='en'" { | |
6914
529f10f7757c
Docs: changes.xml dates converted to ISO 8601 format.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4028
diff
changeset
|
38 !{substring(@date, 9, 2)} |
450 | 39 !{$conf/changes[@lang=$lang]/month[number(substring(current()/@date, |
6914
529f10f7757c
Docs: changes.xml dates converted to ISO 8601 format.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4028
diff
changeset
|
40 6, 2))]} |
529f10f7757c
Docs: changes.xml dates converted to ISO 8601 format.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4028
diff
changeset
|
41 !{substring(@date, 1, 4)} |
450 | 42 } |
43 | |
44 X:text { } | |
45 | |
46 !! "change"; | |
47 | |
48 X:text { } | |
49 } | |
50 | |
51 | |
52 X:template = "change" { | |
53 X:var prefix = "$conf/changes[@lang=$lang]/*[local-name(.)=current()/@type]" | |
54 | |
55 X:var postfix = { X:if "$prefix" { X:text {: } } } | |
56 | |
57 !! "para[@lang=$lang]" (prefix = "concat($start, $prefix, $postfix)"); | |
58 } | |
59 | |
60 | |
61 X:template para(prefix) = "para" { | |
62 X:var text = { !!; } | |
63 | |
64 X:text { } | |
65 | |
66 !wrap(text = "normalize-space($text)", | |
67 prefix = { X:if "position() = 1" { !{$prefix} } else { !{$indent} } }) | |
68 } | |
69 | |
70 | |
71 X:template wrap(text, prefix) { | |
72 X:if "$text" { | |
73 X:var offset = { | |
4022
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
74 X:choose { |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
75 X:when "starts-with($text, concat($br, ' '))" { |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
76 !{string-length($br) + 2} |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
77 } |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
78 X:when "starts-with($text, $br)" { |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
79 !{string-length($br) + 1} |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
80 } |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
81 X:otherwise { |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
82 1 |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
83 } |
450 | 84 } |
85 } | |
86 | |
87 X:var length = { | |
88 !length(text = "substring($text, $offset)", | |
89 prefix = "string-length($prefix)", | |
90 length = "$max") | |
91 } | |
92 | |
93 !{$prefix} | |
94 | |
4025
7b85e695600a
Traling spaces removal in text CHANGES files.
Igor Sysoev <igor@sysoev.ru>
parents:
4022
diff
changeset
|
95 !{normalize-space(translate(substring($text, $offset, $length), |
7b85e695600a
Traling spaces removal in text CHANGES files.
Igor Sysoev <igor@sysoev.ru>
parents:
4022
diff
changeset
|
96 ' ', ' '))} |
450 | 97 |
98 X:text { } | |
99 | |
100 !wrap(text = "substring($text, $length + $offset)", prefix = "$indent") | |
101 } | |
102 } | |
103 | |
104 | |
105 X:template length(text, prefix, length) { | |
4022
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
106 X:var break = "substring-before(substring($text, 1, |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
107 $length - $prefix + string-length($br)), |
450 | 108 $br)" |
109 | |
110 X:choose { | |
111 X:when "$break" { !{string-length($break)} } | |
112 | |
4022
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
113 X:when "$length = 0" { !{$max - $prefix} } |
450 | 114 |
4022
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
115 X:when "string-length($text) + $prefix <= $length" { |
450 | 116 !{$length - $prefix} |
117 } | |
118 | |
4022
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
119 X:when "substring($text, $length - $prefix + 1, 1) = ' '" { |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
120 !{$length - $prefix + 1} |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
121 } |
10b3b7908efb
- support <br/> in the middle of input
Ruslan Ermilov <ru@nginx.com>
parents:
450
diff
changeset
|
122 |
450 | 123 X:otherwise { |
124 !length(text = "$text", prefix = "$prefix", length = "$length - 1") | |
125 } | |
126 } | |
127 } | |
128 | |
129 | |
130 X:template = "at" {@} | |
131 X:template = "br" { !{$br} } | |
132 X:template = "nobr" { !{translate(., ' ', ' ')} } | |
133 | |
134 | |
135 } |