# Django server logging

**URL:** <https://forum.djangoproject.com/t/django-server-logging/12956>\
**Category:** Deployment\
**Created:** [April 1, 2022, 5:16pm UTC](https://forum.djangoproject.com/t/django-server-logging/12956 "2022-04-01T17:16:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [April 1, 2022, 5:16pm UTC](https://forum.djangoproject.com/t/django-server-logging/12956/1 "2022-04-01T17:16:24Z")

</div>

I tried googling but didnt find a good answer.  
Can I in an easy way log all the server status messages to a model, file or the database, so it can be inspected later in a template or the admin?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 1, 2022, 6:27pm UTC](https://forum.djangoproject.com/t/django-server-logging/12956/2 "2022-04-01T18:27:21Z")

</div>

Are you referring to the http response codes? (e.g. 200, 404, etc)

Those are usually logged by your web server to files. That logging information can usually also be directed to syslog which can be configured to put that information just about anywhere desired.

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [April 1, 2022, 6:45pm UTC](https://forum.djangoproject.com/t/django-server-logging/12956/3 "2022-04-01T18:45:04Z")

</div>

> [@KenWhitesell](#):
>
> Those are usually logged by your web server to files. That logging information can usually also be directed to syslog which can be configured to put that information just about anywhere desired.

Are there any good ressources on this anywhere?

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [April 1, 2022, 6:45pm UTC](https://forum.djangoproject.com/t/django-server-logging/12956/4 "2022-04-01T18:45:52Z")

</div>

> [@KenWhitesell](#):
>
> Are you referring to the http response codes? (e.g. 200, 404, etc)

Yes I am. Exastly those 🙂

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 1, 2022, 7:36pm UTC](https://forum.djangoproject.com/t/django-server-logging/12956/5 "2022-04-01T19:36:55Z")

</div>

Somewhat depends upon which web server you’re using.

For example, if you’re using nginx, see [Configuring Logging | NGINX Plus](https://docs.nginx.com/nginx/admin-guide/monitoring/logging/)

You could write your own syslog daemon to write the data to a database, or you could investigate a product like [syslog-ng](https://www.syslog-ng.com/products/open-source-log-management/).

Or you could create a job that runs daily after the logs are rotated, and copy the desired data from the files to another file or database.

Or you could tail the log files and capture that data in near-real-time. (Log rotation can be a bit of an issue, but can be handled.)

---

<div class="post-metadata">

**Author:** ![qvisty](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/qvisty/32/4818_2.png) [@qvisty](https://forum.djangoproject.com/u/qvisty)\
**Post date:** [April 1, 2022, 8:38pm UTC](https://forum.djangoproject.com/t/django-server-logging/12956/6 "2022-04-01T20:38:10Z")

</div>

I will have a look at those. Thank you 😊
