Mercurial > hg > nginx
annotate docs/xslt/changes.xslt @ 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 | de20142f5046 |
children |
rev | line source |
---|---|
450 | 1 <?xml version="1.0" encoding="utf-8"?> |
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
3 | |
5586 | 4 <xsl:output method="text"/> |
4014 | 5 |
5586 | 6 <xsl:param select="'en'" name="lang"/> |
7 <xsl:param select="'../xml/change_log_conf.xml'" name="configuration"/> | |
4014 | 8 |
5586 | 9 <xsl:variable select="document($configuration)/configuration" name="conf"/> |
10 <xsl:variable select="$conf/start" name="start"/> | |
11 <xsl:variable select="$conf/indent" name="indent"/> | |
12 <xsl:variable select="$conf/length" name="max"/> | |
13 <xsl:variable name="br"><br></xsl:variable> | |
4014 | 14 |
15 | |
5586 | 16 <xsl:template match="/"> <xsl:apply-templates select="change_log"/> </xsl:template> |
9216
de20142f5046
Free nginx: regenerated changes.xslt after previous commit.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6915
diff
changeset
|
17 <xsl:template match="change_log"> <xsl:apply-templates select="section"/> </xsl:template> |
de20142f5046
Free nginx: regenerated changes.xslt after previous commit.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6915
diff
changeset
|
18 <xsl:template match="section"> <xsl:apply-templates select="changes"/> </xsl:template> |
4014 | 19 |
20 | |
5586 | 21 <xsl:template match="changes"> |
22 <xsl:text> </xsl:text> | |
450 | 23 |
5586 | 24 <xsl:value-of select="substring(concat($conf/changes[@lang=$lang]/title, |
9216
de20142f5046
Free nginx: regenerated changes.xslt after previous commit.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6915
diff
changeset
|
25 ../@title, |
5586 | 26 ' ', @ver, |
27 ' '), | |
28 1, $conf/changes[@lang=$lang]/length)"/> | |
450 | 29 |
6915
b7e02f47a339
Docs: changes.xslt regenerated.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5586
diff
changeset
|
30 <xsl:if test="$lang='ru'"> |
b7e02f47a339
Docs: changes.xslt regenerated.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5586
diff
changeset
|
31 <xsl:value-of select="substring(@date, 9, 2)"/> |
b7e02f47a339
Docs: changes.xslt regenerated.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5586
diff
changeset
|
32 <xsl:text>.</xsl:text> |
b7e02f47a339
Docs: changes.xslt regenerated.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5586
diff
changeset
|
33 <xsl:value-of select="substring(@date, 6, 2)"/> |
b7e02f47a339
Docs: changes.xslt regenerated.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5586
diff
changeset
|
34 <xsl:text>.</xsl:text> |
b7e02f47a339
Docs: changes.xslt regenerated.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5586
diff
changeset
|
35 <xsl:value-of select="substring(@date, 1, 4)"/> |
b7e02f47a339
Docs: changes.xslt regenerated.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5586
diff
changeset
|
36 </xsl:if> |
4014 | 37 |
5586 | 38 <xsl:if test="$lang='en'"> |
6915
b7e02f47a339
Docs: changes.xslt regenerated.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5586
diff
changeset
|
39 <xsl:value-of select="substring(@date, 9, 2)"/> |
5586 | 40 <xsl:value-of select="$conf/changes[@lang=$lang]/month[number(substring(current()/@date, |
6915
b7e02f47a339
Docs: changes.xslt regenerated.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5586
diff
changeset
|
41 6, 2))]"/> |
b7e02f47a339
Docs: changes.xslt regenerated.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5586
diff
changeset
|
42 <xsl:value-of select="substring(@date, 1, 4)"/> |
5586 | 43 </xsl:if> |
450 | 44 |
5586 | 45 <xsl:text> </xsl:text> |
46 | |
47 <xsl:apply-templates select="change"/> | |
450 | 48 |
5586 | 49 <xsl:text> </xsl:text> |
50 </xsl:template> | |
4014 | 51 |
450 | 52 |
5586 | 53 <xsl:template match="change"> |
54 <xsl:variable select="$conf/changes[@lang=$lang]/*[local-name(.)=current()/@type]" name="prefix"/> | |
450 | 55 |
5586 | 56 <xsl:variable name="postfix"> <xsl:if test="$prefix"> <xsl:text>: </xsl:text> </xsl:if> </xsl:variable> |
57 | |
58 <xsl:apply-templates select="para[@lang=$lang]"><xsl:with-param select="concat($start, $prefix, $postfix)" name="prefix"/></xsl:apply-templates> | |
59 </xsl:template> | |
450 | 60 |
4014 | 61 |
5586 | 62 <xsl:template name="para" match="para"><xsl:param name="prefix"/> |
63 <xsl:variable name="text"> <xsl:apply-templates/> </xsl:variable> | |
450 | 64 |
5586 | 65 <xsl:text> </xsl:text> |
450 | 66 |
5586 | 67 <xsl:call-template name="wrap"><xsl:with-param select="normalize-space($text)" name="text"/><xsl:with-param name="prefix"> <xsl:choose><xsl:when test="position() = 1"> <xsl:value-of select="$prefix"/> </xsl:when><xsl:otherwise> <xsl:value-of select="$indent"/> </xsl:otherwise></xsl:choose> </xsl:with-param></xsl:call-template></xsl:template> |
68 | |
4014 | 69 |
5586 | 70 <xsl:template name="wrap"><xsl:param name="text"/><xsl:param name="prefix"/> |
71 <xsl:if test="$text"> | |
72 <xsl:variable name="offset"> | |
450 | 73 <xsl:choose> |
5586 | 74 <xsl:when test="starts-with($text, concat($br, ' '))"> |
75 <xsl:value-of select="string-length($br) + 2"/> | |
76 </xsl:when> | |
77 <xsl:when test="starts-with($text, $br)"> | |
78 <xsl:value-of select="string-length($br) + 1"/> | |
79 </xsl:when> | |
80 <xsl:otherwise> | |
81 1 | |
82 </xsl:otherwise> | |
450 | 83 </xsl:choose> |
5586 | 84 </xsl:variable> |
4014 | 85 |
5586 | 86 <xsl:variable name="length"> |
87 <xsl:call-template name="length"><xsl:with-param select="substring($text, $offset)" name="text"/><xsl:with-param select="string-length($prefix)" name="prefix"/><xsl:with-param select="$max" name="length"/></xsl:call-template></xsl:variable> | |
88 | |
89 <xsl:value-of select="$prefix"/> | |
4014 | 90 |
5586 | 91 <xsl:value-of select="normalize-space(translate(substring($text, $offset, $length), |
92 ' ', ' '))"/> | |
450 | 93 |
5586 | 94 <xsl:text> </xsl:text> |
450 | 95 |
5586 | 96 <xsl:call-template name="wrap"><xsl:with-param select="substring($text, $length + $offset)" name="text"/><xsl:with-param select="$indent" name="prefix"/></xsl:call-template></xsl:if> |
97 </xsl:template> | |
450 | 98 |
5586 | 99 |
100 <xsl:template name="length"><xsl:param name="text"/><xsl:param name="prefix"/><xsl:param name="length"/> | |
101 <xsl:variable select="substring-before(substring($text, 1, | |
102 $length - $prefix + string-length($br)), | |
103 $br)" name="break"/> | |
4014 | 104 |
5586 | 105 <xsl:choose> |
106 <xsl:when test="$break"> <xsl:value-of select="string-length($break)"/> </xsl:when> | |
4014 | 107 |
5586 | 108 <xsl:when test="$length = 0"> <xsl:value-of select="$max - $prefix"/> </xsl:when> |
109 | |
110 <xsl:when test="string-length($text) + $prefix <= $length"> | |
450 | 111 <xsl:value-of select="$length - $prefix"/> |
5586 | 112 </xsl:when> |
113 | |
114 <xsl:when test="substring($text, $length - $prefix + 1, 1) = ' '"> | |
4024 | 115 <xsl:value-of select="$length - $prefix + 1"/> |
5586 | 116 </xsl:when> |
4024 | 117 |
5586 | 118 <xsl:otherwise> |
119 <xsl:call-template name="length"><xsl:with-param select="$text" name="text"/><xsl:with-param select="$prefix" name="prefix"/><xsl:with-param select="$length - 1" name="length"/></xsl:call-template></xsl:otherwise> | |
120 </xsl:choose> | |
121 </xsl:template> | |
450 | 122 |
4014 | 123 |
5586 | 124 <xsl:template match="at">@</xsl:template> |
125 <xsl:template match="br"> <xsl:value-of select="$br"/> </xsl:template> | |
126 <xsl:template match="nobr"> <xsl:value-of select="translate(., ' ', ' ')"/> </xsl:template> | |
4014 | 127 |
128 | |
129 </xsl:stylesheet> |