ILogger
interface that provides a common API for their logging purposes.Logger
class that implements the ILogger
interface. These loggers offer basic functionality that allow us to jump into using logging features without dedicating too much time to develop our own implementation first.DEBUG
TRACE
INFO
WARN
ERROR
SEVERE
Logger
class. Check the class documentation to see which log levels the logger may utilize.LoggerProvider
is the highest level class that we interact with when utilizing logging functions in the SDKs. The logger provider allows components within the SDKs to share log settings and resources and helps us save resources as well.LoggerProvider
we must pass an instance of a class implementing the ILogger
interface, such as the Logger
class built into the SDKs as shown in the example below:LoggerProvider
we may also choose to define the default message level and the default debug level it calls the logger on as shown in the example below:LoggerProvider
sets the message level to INFO
and the debug level to DEBUG
if we do not define them ourselves.HttpLogLevel
to define the log levels we may use for HTTP traffic. These log levels are:NONE
BASIC
HEADERS
BODY
NONE
making this an opt-in feature, which will require us to declare the log level we will want to use. BASIC
enables logging of the request method (e.g. GET
, POST
, etc...), the URI, the content-length as well as the response's status, URI, and round-trip time. HEADERS
is similar to BASIC
, but also includes the request and response headers. And finally, BODY
logs similar information as HEADERS
but also includes the entire content body of out going requests and incoming responses.BODY
log level, any AuthProject
request will be logged as well as the project's secret key which is sent as a parameter of the request.LoggerProvider
that log messages will be sent to as shown in the example below:PusherEventService
may be configured to log incoming cloud events or any errors it encounters by providing its builder with a logger provider as shown below: