[PR #5195] [CLOSED] Fixes 5194 logger should be initialized elsewhere. #12980

Closed
opened 2025-12-29 22:24:42 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/5195
Author: @nniehoff
Created: 9/29/2020
Status: Closed

Base: developHead: fix_cpuusage


📝 Commits (1)

  • a6acbfa Fixes 5194 logger should be initialized elsewhere.

📊 Changes

1 file changed (+3 additions, -5 deletions)

View changed files

📝 netbox/netbox/authentication.py (+3 -5)

📄 Description

Fixes: 5194

After digging into the CPU usage in our environment I generated several flamegraphs to determine what function was using the CPU time. I found most of the time being spent in addHandler on line 177. The addHandler and setLevel I believe should be handled by the LOGGING definition in configuration.py or as documented here in ldap_config.py. I also moved the ldap_logger definition to the beginning of the new method as this follow existing standards. Please let me know if something else, like docs, should be changed and I'd be happy to make those changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/5195 **Author:** [@nniehoff](https://github.com/nniehoff) **Created:** 9/29/2020 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `fix_cpuusage` --- ### 📝 Commits (1) - [`a6acbfa`](https://github.com/netbox-community/netbox/commit/a6acbfa429f23c85bb2a4ee86c90f9b25dc7790b) Fixes 5194 logger should be initialized elsewhere. ### 📊 Changes **1 file changed** (+3 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/authentication.py` (+3 -5) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be opened for approval prior to filing a pull request. This helps avoid wasting time and effort on something that we might not be able to accept. Please indicate the relevant feature request or bug report below. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ACCEPTED BUG REPORT OR FEATURE REQUEST, IT WILL BE MARKED AS INVALID AND CLOSED. --> ### Fixes: 5194 <!-- Please include a summary of the proposed changes below. --> After digging into the CPU usage in our environment I generated several flamegraphs to determine what function was using the CPU time. I found most of the time being spent in addHandler on line 177. The addHandler and setLevel I believe should be handled by the LOGGING definition in configuration.py or as documented [here](https://netbox.readthedocs.io/en/stable/installation/6-ldap/) in ldap_config.py. I also moved the ldap_logger definition to the beginning of the __new__ method as this follow existing standards. Please let me know if something else, like docs, should be changed and I'd be happy to make those changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:24:42 +01:00
adam closed this issue 2025-12-29 22:24:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12980