Skip to content

Commit 7d2c48b

Browse files
committed
Update README
1 parent 7c7b72e commit 7d2c48b

File tree

2 files changed

+44
-19
lines changed

2 files changed

+44
-19
lines changed

README.md

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,46 @@
1-
![Build Status](https://github.com/madzak/python-json-logger/actions/workflows/build.yml/badge.svg)
1+
![Build Status](https://github.com/nhairs/python-json-logger/actions/workflows/test-suite.yml/badge.svg)
22
[![License](https://img.shields.io/pypi/l/python-json-logger.svg)](https://pypi.python.org/pypi/python-json-logger/)
33
[![Version](https://img.shields.io/pypi/v/python-json-logger.svg)](https://pypi.python.org/pypi/python-json-logger/)
44

5-
**Important:** This repository is a maintained fork of [madzak/python-json-logger](https://github.com/madzak/python-json-logger) pending [a PEP 541 request](https://github.com/pypi/support/issues/3607) for the PyPI package. The future direction of the project is being discussed [here](https://github.com/nhairs/python-json-logger/issues/1).
5+
# Python JSON Logger
66

7-
Overview
8-
=======
97
This library is provided to allow standard python logging to output log data as json objects. With JSON we can make our logs more readable by machines and we can stop writing custom parsers for syslog type records.
108

11-
Installing
12-
==========
139

14-
Until the PEP 541 request is complete you will need to find your own means of installing the package (e.g. building and storing in a private package repository).
10+
### 🚨 Important 🚨
1511

16-
Usage
17-
=====
12+
This repository is a maintained fork of [madzak/python-json-logger](https://github.com/madzak/python-json-logger) pending [a PEP 541 request](https://github.com/pypi/support/issues/3607) for the PyPI package. The future direction of the project is being discussed [here](https://github.com/nhairs/python-json-logger/issues/1).
1813

19-
## Integrating with Python's logging framework
14+
## Installation
15+
16+
### Install via pip / PyPI
17+
18+
Until the PEP 541 request is complete you will need to use one of the alternative methods below.
19+
20+
### Install from GitHub
21+
22+
```shell
23+
pip install 'python-json-logger@git+https://github.com/nhairs/python-json-logger.git'
24+
```
25+
26+
To install a specific version:
27+
28+
```shell
29+
pip install 'python-json-logger@git+https://github.com/nhairs/python-json-logger.git@v2.0.7'
30+
```
31+
32+
33+
### Install from Source
34+
35+
```shell
36+
git clone https://github.com/nhairs/python-json-logger.git
37+
cd python-json-logger
38+
pip install -e .
39+
```
40+
41+
## Usage
42+
43+
### Integrating with Python's logging framework
2044

2145
Json outputs are provided by the JsonFormatter logging formatter. You can add the custom formatter like below:
2246

@@ -34,7 +58,7 @@ Json outputs are provided by the JsonFormatter logging formatter. You can add th
3458
logger.addHandler(logHandler)
3559
```
3660

37-
## Customizing fields
61+
### Customizing fields
3862

3963
The fmt parser can also be overidden if you want to have required fields that differ from the default of just `message`.
4064

@@ -76,7 +100,7 @@ formatter = CustomJsonFormatter('%(timestamp)s %(level)s %(name)s %(message)s')
76100

77101
Items added to the log record will be included in *every* log message, no matter what the format requires.
78102

79-
## Adding custom object serialization
103+
### Adding custom object serialization
80104

81105
For custom handling of object serialization you can specify default json object translator or provide a custom encoder
82106

@@ -93,7 +117,7 @@ logger.info({"special": "value", "run": 12})
93117
logger.info("classic message", extra={"special": "value", "run": 12})
94118
```
95119

96-
## Using a Config File
120+
### Using a Config File
97121

98122
To use the module with a config file using the [`fileConfig` function](https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig), use the class `pythonjsonlogger.jsonlogger.JsonFormatter`. Here is a sample config file.
99123

@@ -126,8 +150,7 @@ format = %(message)s
126150
class = pythonjsonlogger.jsonlogger.JsonFormatter
127151
```
128152

129-
Example Output
130-
==============
153+
## Example Output
131154

132155
Sample JSON with a full formatter (basically the log message from the unit test). Every log message will appear on 1 line like a typical logger.
133156

@@ -155,10 +178,13 @@ Sample JSON with a full formatter (basically the log message from the unit test)
155178
}
156179
```
157180

158-
Author and Maintainers
159-
======================
181+
## License
182+
183+
This project is licensed under the BSD 2 Clause License - see [`LICENSE`](https://github.com/nhairs/python-json-logger/blob/main/LICENSE)
184+
185+
## Authors and Maintainers
160186

161-
This project was originally authored by [Zakaria Zajac](https://github.com/madzak).
187+
This project was originally authored by [Zakaria Zajac](https://github.com/madzak) and our wonderful [contributors](https://github.com/nhairs/python-json-logger/graphs/contributors)
162188

163189
It is currently maintained by:
164190

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ description = run unit tests
2020
extras = test
2121
commands =
2222
pytest tests
23-
# python -m unittest discover
2423

2524
[testenv:format]
2625
description = run formatters

0 commit comments

Comments
 (0)