solnlib is using root logger to log things
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Refactoring
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- backend, observability-sre
Direzione di ricerca
Start by comparing logging in solnlib/timer_queue.py with the module logger pattern in urllib3, then inspect the error path in solnlib/rest.py. The issue requires deciding which messages should reach Splunkd and whether changing logger behavior affects callers. Done means an agreed, consistent logging policy is applied without suppressing necessary errors or introducing an unintended breaking change.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Issue Description:
I think the main issue is that any INFO or DEBUG logs in solnlib are going into Splunkd as ERROR logs.
I think the logging currently is not as per best practice. Currently it uses logging.info , which puts logs in splunkd. : https://github.com/splunk/addonfactory-solutions-library-python/blob/develop/solnlib/timer_queue.py#L234
I think the best practice should be to initialize a logger for the module and not using logging.info directly. That is how I have seen other third party libraries doing. For Example urllib3 that requests uses : https://github.com/urllib3/urllib3/blob/main/src/urllib3/connectionpool.py#L61
Other notes :
I was trying to do the same thing in solnlib like urllib3 but I see that in certain places it can cause issue like this : https://github.com/splunk/addonfactory-solutions-library-python/blob/develop/solnlib/rest.py#L67
Here the error is the only way someone can know that something went wrong cause we are not raising an exception. If we turn off this logger by default, it will suppress necessary information and if we raise an error from here, it would mean a breaking change for someone using this method.
Also, there are certain places where somone can argue that error should go into splunkd. Thus, we might need to make a decision on this behaviour of solnlib.
Slack Conversation with example logs : https://splunk.slack.com/archives/C03T8QCHBTJ/p1748939756182799
- Lingua principale
- Python
- Stelle
- 18
- Fork
- 10
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di splunk/addonfactory-solutions-library-python
-
Log rotation is not functioning properly for multi-instance Splunk TAs.Forse di nuovo libera @artemrys l’ha presa 637 giorni fa e non c’è nessuna pull request aperta. Aperta
splunk/addonfactory-solutions-library-python#420 · 4 commenti · 1 assegnatario ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
splunk/addonfactory-solutions-library-python#334 · 6 commenti ·
-
TypeError when getting passwordsForse di nuovo libera @artemrys l’ha presa 1096 giorni fa e non c’è nessuna pull request aperta. Apertabug
splunk/addonfactory-solutions-library-python#311 · 2 commenti · 1 assegnatario ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
-
Add Contributing GuidelinesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
Tutte le issue di splunk/addonfactory-solutions-library-python
Issue simili
-
New InternshipApertanew_internship
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
-
[BUG] Reports tab: "Unban" button tooltip shows raw `{{ip}}` placeholder instead of the IP addressApertabug javascript ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bunkerity/bunkerweb#4001 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
PedestrianDynamics/pyFDS-Evac#476 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google/differential-privacy#516 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
adobe-fonts/source-serif#153 ·