On 2019-04-24 16:23:15, Willem Mulder wrote:
> On Wed, 24 Apr 2019 01:03:35 +0000 Linda Lapinlampi <[email protected]>
> wrote:
>> I also agree the logs should be compressed on daily rotation, but it
>> remains unclear to me how one would change this in Synapse without big
>> hacky behaviors. Preferably I'd use logrotate(8) if at all possible.
>>
>> This might be helpful:
>> https://docs.python.org/3/library/logging.handlers.html
>>
>> So maybe change logging.handlers.RotatingFileHandler in debian/log.yaml
>> to WatchFileHandler (use with logrotate(8)) if I've understood
>> correctly. TimedRotatingFileHandler is an alternative to let Python
> manage log
>> rotation by itself, but no logs will be compressed then.
>
> On my personal setup, I have the following changes to log.yaml:
[...]
I believe the attached debdiff fixes this problem.
A.
--
Nothing in life is to be feared, it is only to be understood.
Now is the time to understand more, so that we may fear less.
- Marie Curie
diff -Nru matrix-synapse-0.99.2/debian/changelog matrix-synapse-0.99.2/debian/changelog
--- matrix-synapse-0.99.2/debian/changelog 2019-03-24 09:02:48.000000000 -0400
+++ matrix-synapse-0.99.2/debian/changelog 2019-04-27 11:48:31.000000000 -0400
@@ -1,3 +1,10 @@
+matrix-synapse (0.99.2-3.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * fix log rotation to be less verbose (Closes: #927057)
+
+ -- Antoine Beaupré <[email protected]> Sat, 27 Apr 2019 11:48:31 -0400
+
matrix-synapse (0.99.2-3) unstable; urgency=medium
* Make the code querying the location of the key file actually work.
diff -Nru matrix-synapse-0.99.2/debian/log.yaml matrix-synapse-0.99.2/debian/log.yaml
--- matrix-synapse-0.99.2/debian/log.yaml 2019-03-24 09:02:48.000000000 -0400
+++ matrix-synapse-0.99.2/debian/log.yaml 2019-04-27 11:48:31.000000000 -0400
@@ -14,12 +14,12 @@
handlers:
file:
- class: logging.handlers.RotatingFileHandler
+ class: logging.handlers.WatchedFileHandler
formatter: precise
filename: /var/log/matrix-synapse/homeserver.log
- maxBytes: 104857600
- backupCount: 10
filters: [context]
+ level: DEBUG
+ encoding: utf8
console:
class: logging.StreamHandler
formatter: precise
@@ -31,12 +31,18 @@
SYSLOG_IDENTIFIER: synapse
loggers:
+ twisted:
+ level: WARN
+
synapse:
- level: INFO
+ level: WARN
synapse.storage.SQL:
level: INFO
+ synapse.http.matrixfederationclient:
+ level: ERROR
+
root:
level: INFO
handlers: [file, journal]
diff -Nru matrix-synapse-0.99.2/debian/matrix-synapse.logrotate matrix-synapse-0.99.2/debian/matrix-synapse.logrotate
--- matrix-synapse-0.99.2/debian/matrix-synapse.logrotate 1969-12-31 19:00:00.000000000 -0500
+++ matrix-synapse-0.99.2/debian/matrix-synapse.logrotate 2019-04-27 11:48:31.000000000 -0400
@@ -0,0 +1,8 @@
+/var/log/matrix-synapse/homeserver.log {
+ rotate 7
+ daily
+ missingok
+ notifempty
+ delaycompress
+ compress
+}