Skip to content

Fix or remove SysLogHandler #43

Open
@tiran

Description

@tiran

slapdtest configured a https://docs.python.org/3/library/logging.handlers.html#logging.handlers.SysLogHandler instance.

if sys_log_format:
my_syslog_formatter = logging.Formatter(
fmt=' '.join((log_name, sys_log_format)))
my_syslog_handler = logging.handlers.SysLogHandler(
address='/dev/log',
facility=SysLogHandler.LOG_DAEMON,
)
my_syslog_handler.setFormatter(my_syslog_formatter)
new_logger.addHandler(my_syslog_handler)

There are three issues:

  • The whole test suite fails when syslog is not available, e.g. in a container or restricted build environment.
  • It hard codes path /dev/log which is not correct on macOS.
  • IMO tests should not log to syslog at all.

PR #28 is a temporary workaround. It modifies logger configuration to omit SysLogHandler when /dev/syslog does not exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions