# HG changeset patch # User Mads Kiilerich # Date 1564535706 -7200 # Node ID 3ea66ef563f24a4949582bd63c197176d666440a # Parent efd088f7903be45dd3ab387f89cf018641ca357f kallithea-cli: use null handler to mute all console logging for ssh-serve Augment logger_root to use the null handler when running ssh-serve. Set the log level to CRITICAL to filter early and minimize the amount of logging sent to the null handler. It is however recommended to configure the system to use some logging facility that can handle logging for SSH access from many different processes. diff -r efd088f7903b -r 3ea66ef563f2 development.ini --- a/development.ini Wed Jul 31 21:53:59 2019 +0200 +++ b/development.ini Wed Jul 31 03:15:06 2019 +0200 @@ -495,3 +495,21 @@ class = kallithea.lib.colored_formatter.ColorFormatterSql format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s datefmt = %Y-%m-%d %H:%M:%S + +################# +## SSH LOGGING ## +################# + +# The default loggers use 'handler_console' that uses StreamHandler with +# destination 'sys.stderr'. In the context of the SSH server process, these log +# messages would be sent to the client, which is normally not what you want. +# By default, when running ssh-serve, just use NullHandler and disable logging +# completely. For other logging options, see: +# https://docs.python.org/2/library/logging.handlers.html + +[ssh_serve:logger_root] +level = CRITICAL +handlers = null + +# Note: If logging is configured with other handlers, they might need similar +# muting for ssh-serve too. diff -r efd088f7903b -r 3ea66ef563f2 kallithea/lib/paster_commands/template.ini.mako --- a/kallithea/lib/paster_commands/template.ini.mako Wed Jul 31 21:53:59 2019 +0200 +++ b/kallithea/lib/paster_commands/template.ini.mako Wed Jul 31 03:15:06 2019 +0200 @@ -677,3 +677,21 @@ class = kallithea.lib.colored_formatter.ColorFormatterSql format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s datefmt = %Y-%m-%d %H:%M:%S + +<%text>################# +<%text>## SSH LOGGING ## +<%text>################# + +# The default loggers use 'handler_console' that uses StreamHandler with +# destination 'sys.stderr'. In the context of the SSH server process, these log +# messages would be sent to the client, which is normally not what you want. +# By default, when running ssh-serve, just use NullHandler and disable logging +# completely. For other logging options, see: +# https://docs.python.org/2/library/logging.handlers.html + +[ssh_serve:logger_root] +level = CRITICAL +handlers = null + +# Note: If logging is configured with other handlers, they might need similar +# muting for ssh-serve too.