summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mailman/commands/docs/conf.rst4
-rw-r--r--src/mailman/config/alembic.cfg36
-rw-r--r--src/mailman/config/schema.cfg12
-rw-r--r--src/mailman/core/logging.py4
-rw-r--r--src/mailman/database/alembic/env.py3
5 files changed, 15 insertions, 44 deletions
diff --git a/src/mailman/commands/docs/conf.rst b/src/mailman/commands/docs/conf.rst
index 7b8529ac3..b3fef9db7 100644
--- a/src/mailman/commands/docs/conf.rst
+++ b/src/mailman/commands/docs/conf.rst
@@ -22,7 +22,7 @@ To get a list of all key-value pairs of any section, you need to call the
command without any options.
>>> command.process(FakeArgs)
- [logging.archiver] path: mailman.log
+ [logging.dbmigration] path: mailman.log
...
[passwords] password_length: 8
...
@@ -43,12 +43,14 @@ key, along with the names of the corresponding sections.
>>> FakeArgs.section = None
>>> FakeArgs.key = 'path'
>>> command.process(FakeArgs)
+ [logging.dbmigration] path: mailman.log
[logging.archiver] path: mailman.log
[logging.locks] path: mailman.log
[logging.mischief] path: mailman.log
[logging.config] path: mailman.log
[logging.error] path: mailman.log
[logging.smtp] path: smtp.log
+ [logging.database] path: mailman.log
[logging.http] path: mailman.log
[logging.root] path: mailman.log
[logging.fromusenet] path: mailman.log
diff --git a/src/mailman/config/alembic.cfg b/src/mailman/config/alembic.cfg
index b1f53a3d2..78c047379 100644
--- a/src/mailman/config/alembic.cfg
+++ b/src/mailman/config/alembic.cfg
@@ -19,39 +19,3 @@ script_location = mailman.database:alembic
# a source .py file to be detected as revisions in the
# versions/ directory
# sourceless = false
-
-
-# Logging configuration
-[loggers]
-keys = root,sqlalchemy,alembic
-
-[handlers]
-keys = console
-
-[formatters]
-keys = generic
-
-[logger_root]
-level = WARN
-handlers = console
-qualname =
-
-[logger_sqlalchemy]
-level = WARN
-handlers = console
-qualname = sqlalchemy.engine
-
-[logger_alembic]
-level = WARN
-handlers = console
-qualname = alembic
-
-[handler_console]
-class = StreamHandler
-args = (sys.stderr,)
-level = WARN
-formatter = generic
-
-[formatter_generic]
-format = %(levelname)-5.5s [%(name)s] %(message)s
-datefmt = %H:%M:%S
diff --git a/src/mailman/config/schema.cfg b/src/mailman/config/schema.cfg
index e8f89ab41..139963788 100644
--- a/src/mailman/config/schema.cfg
+++ b/src/mailman/config/schema.cfg
@@ -204,10 +204,6 @@ class: mailman.database.sqlite.SQLiteDatabase
url: sqlite:///$DATA_DIR/mailman.db
debug: no
-# Where can we find the Alembic migration scripts? The `python:` schema means
-# that this is a module path relative to the Mailman 3 source installation.
-alembic_scripts: mailman.database:alembic
-
[logging.template]
# This defines various log settings. The options available are:
@@ -242,6 +238,8 @@ alembic_scripts: mailman.database:alembic
# - smtp-failure -- Unsuccessful SMTP activity
# - subscribe -- Information about leaves/joins
# - vette -- Message vetting information
+# - database -- Database activity
+# - dbmigration -- Database migrations
format: %(asctime)s (%(process)d) %(message)s
datefmt: %b %d %H:%M:%S %Y
propagate: no
@@ -306,6 +304,12 @@ failure: $msgid delivery to $recip failed with code $smtpcode, $smtpmsg
[logging.vette]
+[logging.database]
+level: warn
+
+[logging.dbmigration]
+level: warn
+
[webservice]
# The hostname at which admin web service resources are exposed.
diff --git a/src/mailman/core/logging.py b/src/mailman/core/logging.py
index 43030436a..591f3c996 100644
--- a/src/mailman/core/logging.py
+++ b/src/mailman/core/logging.py
@@ -126,6 +126,10 @@ def initialize(propagate=None):
continue
if sub_name == 'locks':
log = logging.getLogger('flufl.lock')
+ elif sub_name == 'database':
+ log = logging.getLogger('sqlalchemy')
+ elif sub_name == 'dbmigration':
+ log = logging.getLogger('alembic')
else:
logger_name = 'mailman.' + sub_name
log = logging.getLogger(logger_name)
diff --git a/src/mailman/database/alembic/env.py b/src/mailman/database/alembic/env.py
index d1caec58d..ffab0fed8 100644
--- a/src/mailman/database/alembic/env.py
+++ b/src/mailman/database/alembic/env.py
@@ -28,7 +28,6 @@ __all__ = [
from alembic import context
from contextlib import closing
-from logging.config import fileConfig
from sqlalchemy import create_engine
from mailman.core import initialize
@@ -39,8 +38,6 @@ from mailman.utilities.modules import expand_path
from mailman.utilities.string import expand
-fileConfig(alembic_cfg.config_file_name)
-
def run_migrations_offline():
"""Run migrations in 'offline' mode.