## log.JsonFormatter

<span id="hexkit.log.JsonFormatter"></span>


A formatter class that outputs logs in JSON format.


Usage

``` python
log.JsonFormatter(
    include_traceback=True,
    *args,
    **kwargs,
)
```


## Methods

| Name | Description |
|----|----|
| [__init__()](#__init__) | Initialize the formatter. |
| [format()](#format) | Format the specified record as a JSON string with non-serializable types |

<span id="__init__"></span>

<span id="hexkit.log.JsonFormatter.__init__"></span>


#### \_\_init\_\_()


Initialize the formatter.


Usage

``` python
__init__(include_traceback=True, *args, **kwargs)
```


<span id="hexkit.log.JsonFormatter.format"></span>

------------------------------------------------------------------------


#### format()


Format the specified record as a JSON string with non-serializable types


Usage

``` python
format(record)
```


converted using repr.

This will format the log record as JSON with the following values (in order): - timestamp: The ISO 8601-formatted timestamp of the log message. - service: The name of the service where the log was generated. - instance: The instance ID of the service where the log was generated. - level: The log's severity. - name: The name of the logger. - correlation_id: The correlation ID, if set, from the current context. - message: The message that was logged, formatted with any arguments. - details: Any additional values included at time of logging. - exception: If an exception was logged, the exception info.
