Mercurial > prosody-modules
annotate misc/mtail/prosody.mtail @ 5853:97c9b76867ca
mod_log_ringbuffer: Detach event handlers on logging reload (thanks Menel)
Otherwise the global event handlers accumulate, one added each time
logging is reoladed, and each invocation of the signal or event triggers
one dump of each created ringbuffer.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 03 Mar 2024 11:23:40 +0100 |
parents | c217f4edfc4f |
children |
rev | line source |
---|---|
5648
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 counter prosody_log_messages by level |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 /^(?P<date>(?P<legacy_date>\w+\s+\d+\s+\d+:\d+:\d+)|(?P<rfc3339_date>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d+[+-]\d{2}:\d{2})) (?P<sink>\S+)\s(?P<loglevel>\w+)\s(?P<message>.*)/ { |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 len($legacy_date) > 0 { |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 strptime($2, "Jan _2 15:04:05") |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 } |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 len($rfc3339_date) > 0 { |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 strptime($rfc3339_date, "2006-01-02T03:04:05-0700") |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 } |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 $loglevel != "" { |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 prosody_log_messages[$loglevel]++ |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 } |
c217f4edfc4f
misc/mtail: Start of an mtail config
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 } |