jina.logging.logger

class jina.logging.logger.NTLogger(context, log_level=<LogVerbosity.INFO: 20>)[source]

Bases: object

A compatible logger for Windows system, colors are all removed to keep compat.

Parameters
  • context (str) – the name prefix of each log

  • verbose – show debug level info

info(msg, **kwargs)[source]

log info-level message

critical(msg, **kwargs)[source]

log critical-level message

debug(msg, **kwargs)[source]

log debug-level message

error(msg, **kwargs)[source]

log error-level message

warning(msg, **kwargs)[source]

log warn-level message

success(msg, **kwargs)[source]

log success-level message

class jina.logging.logger.PrintLogger(context, log_level=<LogVerbosity.INFO: 20>)[source]

Bases: jina.logging.logger.NTLogger

A compatible logger for Windows system, colors are all removed to keep compat.

Parameters
  • context (str) – the name prefix of each log

  • verbose – show debug level info

class jina.logging.logger.SysLogHandlerWrapper(address=('localhost', 514), facility=1, socktype=None)[source]

Bases: logging.handlers.SysLogHandler

Override the priority_map SysLogHandler

Warning

This messages at DEBUG and INFO are therefore not stored by ASL, (ASL = Apple System Log) which in turn means they can’t be printed by syslog after the fact. You can confirm it via syslog or tail -f /var/log/system.log

Initialize a handler.

If address is specified as a string, a UNIX socket is used. To log to a local syslogd, “SysLogHandler(address=”/dev/log”)” can be used. If facility is not specified, LOG_USER is used. If socktype is specified as socket.SOCK_DGRAM or socket.SOCK_STREAM, that specific socket type will be used. For Unix sockets, you can also specify a socktype of None, in which case socket.SOCK_DGRAM will be used, falling back to socket.SOCK_STREAM.

priority_map = {'CRITICAL': 'critical', 'DEBUG': 'debug', 'ERROR': 'error', 'INFO': 'info', 'SUCCESS': 'notice', 'WARNING': 'warning'}
class jina.logging.logger.JinaLogger(context, name=None, log_config=None, log_id=None, **kwargs)[source]

Bases: object

Build a logger for a context :type context: str :param context: The context identifier of the class, module or method :type log_config: Optional[str] :param log_config: the configuration file for the logger :type log_id: Optional[str] :param log_id: the id of the group the messages from this logger will belong, used by fluentd default configuration to group logs by pod :return: an executor object

supported = {'FileHandler', 'FluentHandler', 'StreamHandler', 'SysLogHandler'}
property handlers
close()[source]
add_handlers(config_path=None, **kwargs)[source]