mailman: log to journal
This commit is contained in:
parent
3dbbc786f5
commit
176bc68a69
@ -185,7 +185,11 @@ in {
|
||||
enable = "yes";
|
||||
configuration = "/var/lib/mailman/mailman-hyperkitty.cfg";
|
||||
};
|
||||
};
|
||||
} // (let
|
||||
loggerNames = ["root" "archiver" "bounce" "config" "database" "debug" "error" "fromusenet" "http" "locks" "mischief" "plugins" "runner" "smtp"];
|
||||
loggerSectionNames = map (n: "logging.${n}") loggerNames;
|
||||
in lib.genAttrs loggerSectionNames(name: { handler = "stderr"; })
|
||||
);
|
||||
|
||||
assertions = let
|
||||
inherit (config.services) postfix;
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ stdenv, buildPythonPackage, fetchPypi, isPy3k, alembic, aiosmtpd, dnspython
|
||||
{ stdenv, buildPythonPackage, fetchPypi, fetchpatch, isPy3k, alembic, aiosmtpd, dnspython
|
||||
, flufl_bounce, flufl_i18n, flufl_lock, lazr_config, lazr_delegates, passlib
|
||||
, requests, zope_configuration, click, falcon, importlib-resources
|
||||
, zope_component, lynx, postfix, authheaders, gunicorn
|
||||
@ -20,7 +20,19 @@ buildPythonPackage rec {
|
||||
zope_component authheaders gunicorn
|
||||
];
|
||||
|
||||
patchPhase = ''
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
url = https://gitlab.com/mailman/mailman/-/commit/4b206e2a5267a0e17f345fd7b2d957122ba57566.patch;
|
||||
sha256 = "06axmrn74p81wvcki36c7gfj5fp5q15zxz2yl3lrvijic7hbs4n2";
|
||||
})
|
||||
(fetchpatch {
|
||||
url = https://gitlab.com/mailman/mailman/-/commit/9613154f3c04fa2383fbf017031ef263c291418d.patch;
|
||||
sha256 = "0vyw87s857vfxbf7kihwb6w094xyxmxbi1bpdqi3ybjamjycp55r";
|
||||
})
|
||||
./log-stderr.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/mailman/config/postfix.cfg \
|
||||
--replace /usr/sbin/postmap ${postfix}/bin/postmap
|
||||
substituteInPlace src/mailman/config/schema.cfg \
|
||||
|
13
pkgs/servers/mail/mailman/log-stderr.patch
Normal file
13
pkgs/servers/mail/mailman/log-stderr.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/src/mailman/core/logging.py b/src/mailman/core/logging.py
|
||||
index f8f87279f..7ff13b003 100644
|
||||
--- a/src/mailman/core/logging.py
|
||||
+++ b/src/mailman/core/logging.py
|
||||
@@ -142,6 +142,8 @@ def _init_logger(propagate, sub_name, log, logger_config):
|
||||
address, facility = _get_syslog_params(logger_config)
|
||||
handler = logging.handlers.SysLogHandler(
|
||||
address=address, facility=facility)
|
||||
+ elif logger_config.handler == 'stderr':
|
||||
+ handler = logging.StreamHandler(sys.stderr)
|
||||
else:
|
||||
path_str = logger_config.path
|
||||
path_abs = os.path.normpath(os.path.join(config.LOG_DIR, path_str))
|
Loading…
Reference in New Issue
Block a user