Changeset - 3ea66ef563f2
[Not reviewed]
default
0 2 0
Mads Kiilerich - 6 years ago 2019-07-31 03:15:06
mads@kiilerich.com
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.
2 files changed with 36 insertions and 0 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -492,6 +492,24 @@ format = %(asctime)s.%(msecs)03d %(level
 
datefmt = %Y-%m-%d %H:%M:%S
 

	
 
[formatter_color_formatter_sql]
 
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.
kallithea/lib/paster_commands/template.ini.mako
Show inline comments
 
@@ -674,6 +674,24 @@ format = %(asctime)s.%(msecs)03d %(level
 
datefmt = %Y-%m-%d %H:%M:%S
 

	
 
[formatter_color_formatter_sql]
 
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>
 
<%text>## SSH LOGGING ##</%text>
 
<%text>#################</%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.
0 comments (0 inline, 0 general)