Application logging in JSON format #7604

Closed
opened 2025-12-29 20:25:57 +01:00 by adam · 1 comment
Owner

Originally created by @K4pper on GitHub (Feb 6, 2023).

NetBox version

v3.4.4

Feature type

New functionality

Proposed functionality

Netbox currently logs in plain text, this makes it hard to extract metadata out of the application logs.

The change logs in netbox are a great example of how i suggest application logs should be formatted, this shouldn't necessarily be the default, but adding an option to format in JSON would be very helpful.

Use case

If the application logs were formatted in JSON you would be able to extract metadata much more easily.
The metadata could be of great help when troubleshooting application errors.

Database changes

N/A

External dependencies

As far as i know there are 2 libraries that could solve this:
https://pypi.org/project/JSON-log-formatter/
https://github.com/madzak/python-json-logger

Originally created by @K4pper on GitHub (Feb 6, 2023). ### NetBox version v3.4.4 ### Feature type New functionality ### Proposed functionality Netbox currently logs in plain text, this makes it hard to extract metadata out of the application logs. The change logs in netbox are a great example of how i suggest application logs should be formatted, this shouldn't necessarily be the default, but adding an option to format in JSON would be very helpful. ### Use case If the application logs were formatted in JSON you would be able to extract metadata much more easily. The metadata could be of great help when troubleshooting application errors. ### Database changes N/A ### External dependencies As far as i know there are 2 libraries that could solve this: https://pypi.org/project/JSON-log-formatter/ https://github.com/madzak/python-json-logger
adam added the type: feature label 2025-12-29 20:25:57 +01:00
adam closed this issue 2025-12-29 20:25:57 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 6, 2023):

You can configure the logging format however you'd like, including by setting a custom handler, by modifying the LOGGING configuration parameter.

@jeremystretch commented on GitHub (Feb 6, 2023): You can configure the logging format however you'd like, including by setting a custom handler, by modifying the [`LOGGING` configuration parameter](https://docs.netbox.dev/en/stable/configuration/system/#logging).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7604