# Sanic Apache Access Logs
Sanic Plugin to log access logs in common or combined format
## How to use
```python
from sanic import Sanic
from sanic.response import json
from sanic_apache_accesslogs import AccessLogPlugin
app = Sanic(__name__, configure_logging=False)
AccessLogPlugin(app)
@app.route('/', methods=['GET'])
async def hello(request):
return json({'hello': 'world'})
if __name__ == '__main__':
app.run(host='localhost', port=5000, access_log=False)
```
## Common or Combined?
For choosing the format set the environment variable `ACCESSLOG_USE_COMBINED` to choose combined over common.
## TODO(s)
* Use Sanic configuration context to choose between the logging format.
## Contact
Arnulfo Solis
arnulfojr94@gmail.com
Sanic Plugin to log access logs in common or combined format
## How to use
```python
from sanic import Sanic
from sanic.response import json
from sanic_apache_accesslogs import AccessLogPlugin
app = Sanic(__name__, configure_logging=False)
AccessLogPlugin(app)
@app.route('/', methods=['GET'])
async def hello(request):
return json({'hello': 'world'})
if __name__ == '__main__':
app.run(host='localhost', port=5000, access_log=False)
```
## Common or Combined?
For choosing the format set the environment variable `ACCESSLOG_USE_COMBINED` to choose combined over common.
## TODO(s)
* Use Sanic configuration context to choose between the logging format.
## Contact
Arnulfo Solis
arnulfojr94@gmail.com
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file sanic_apache_accesslogs-0.2.1.tar.gz.
File metadata
- Download URL: sanic_apache_accesslogs-0.2.1.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ab7d4ceea54dda959d8503d96b415635e06e9d6aaf75c0ff3f3ee02af19d8cc
|
|
| MD5 |
2897d5268d1e1f7268882c4294e46315
|
|
| BLAKE2b-256 |
a0864638cb03aeec6f6c8c87d887e00539b7cef245044858054b86c1bd4021d3
|