Configuration

Configuration for clog.global_state. The following configuration settings are supported:

scribe_host
(string) hostname of a scribe service used by clog.log_line() to write logs to scribe
scribe_port
(int) port of the abovementioned scribe service
scribe_retry_interval
number of seconds to wait before retrying a connection to scribe. Used by clog.log_line() (default 10)
log_dir
directory used to store files when clog_enable_file_logging is enabled. Defaults to the value of $TMPDIR, or /tmp if unset
scribe_disable
disable writing any logs to scribe (default True)
scribe_errors_to_syslog
flag to enable sending errors to syslog, otherwise to stderr (default False)
scribe_logging_timeout
number of milliseconds to wait on socket connection to scribe server. This prevents from being blocked forever on, e.g., writing to scribe server. If a write times out, the delivery of the log line is not guaranteed and the status of the delivery is unknown; it can be either succeeded or failed. For backward compatibility, the old default blocking behavior is on when this parameter is left unset or set to 0; both the values None and 0 are treated as “infinite”.
clog_enable_file_logging
flag to enable logging to local files. (Default False)
clog_enable_stdout_logging
flag to enable logging to stdout. Each log line is prefixed with the stream name. (Default False)
localS3
If True, will fetch s3 files directly rather than talking to a service.
clog.config.configure(scribe_host, scribe_port, **kwargs)

Configure the clog package from arguments.

Parameters:
  • scribe_host – the scribe service hostname
  • scribe_port – the scribe service port
  • kwargs – other configuration parameters
clog.config.configure_from_dict(config_dict)

Configure the clog package from a dictionary.

Parameters:config_dict – a dict of config data
clog.config.configure_from_object(config_obj)

Configure the clog package from an object (or module).

Parameters:config_obj – an object or module with config attributes