Config
in package
Central configuration of the carddavclient library.
Tags
Table of Contents
Constants
- GUZZLE_LOGFMT_DEBUG : mixed = '"{method} {target} HTTP/{version}" {code}' . "...
- GUZZLE_LOGFMT_SHORT : mixed = '"{method} {target} HTTP/{version}" {code} {res...
Properties
- $httplogger : LoggerInterface
- $logger : LoggerInterface
- $options : LibOptions
- Configuration options of the library.
Methods
- init() : void
- Initialize the library.
Constants
GUZZLE_LOGFMT_DEBUG
public
mixed
GUZZLE_LOGFMT_DEBUG
= '"{method} {target} HTTP/{version}" {code}' . "\n>>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"
GUZZLE_LOGFMT_SHORT
public
mixed
GUZZLE_LOGFMT_SHORT
= '"{method} {target} HTTP/{version}" {code} {res_header_Content-Length}'
Properties
$httplogger
public
static LoggerInterface
$httplogger
$logger
public
static LoggerInterface
$logger
$options
Configuration options of the library.
public
static LibOptions
$options
= ['guzzle_logformat' => self::GUZZLE_LOGFMT_DEBUG]
Tags
Methods
init()
Initialize the library.
public
static init([LoggerInterface|null $logger = null ][, LoggerInterface|null $httplogger = null ][, array<string|int, mixed> $options = [] ]) : void
The functions accepts two logger objects complying with the standard PSR-3 Logger interface, one of which is used by the carddavclient lib itself, the other is passed to the HTTP client library to log the HTTP traffic. Pass null for any logger to disable the corresponding logging.
The $options parameter allows to override the default behavior of the library in various options. It is an associative array that may have the following keys and values:
- guzzle_logformat(string):
Value is a string defining the HTTP log format when Guzzle is used as HTTP client library. See the
documentation of the Guzzle MessageFormatter class for the available placeholders. This class offers two
constants that can be used as template:
- Config::GUZZLE_LOGFMT_SHORT: A compact log format with only request type/URI and the response status and content length
- Config::GUZZLE_LOGFMT_DEBUG: The default, which logs the full HTTP traffic including request bodies and response bodies.
Parameters
- $logger : LoggerInterface|null = null
- $httplogger : LoggerInterface|null = null
- $options : array<string|int, mixed> = []