solnlib is using root logger to log things
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 30/100
- Type d'issue
- Refactorisation
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- python
- Domaine
- backend, observability-sre
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Python
- Étoiles
- 18
- Forks
- 10
- Merge moyen
- 3 j 10 h
- PR mergées (30 j)
- 1
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de splunk/addonfactory-solutions-library-python
-
Log rotation is not functioning properly for multi-instance Splunk TAs.Peut-être à nouveau libre @artemrys l’a pris il y a 647 jours, et aucune pull request n’est ouverte. Ouverte
splunk/addonfactory-solutions-library-python#420 · 4 commentaires · 1 personne assignée ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
splunk/addonfactory-solutions-library-python#334 · 6 commentaires ·
-
TypeError when getting passwordsPeut-être à nouveau libre @artemrys l’a pris il y a 1106 jours, et aucune pull request n’est ouverte. Ouvertebug
splunk/addonfactory-solutions-library-python#311 · 2 commentaires · 1 personne assignée ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 48/100
-
Add Contributing GuidelinesOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 48/100
Toutes les issues de splunk/addonfactory-solutions-library-python
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
huggingface/smolagents#2976 ·
Les mainteneurs répondent en général sous 1 jour
-
pulp-cli 0.41 break username password auth in older configs (cert and key present but empty)Ouvertebug Triage-Needed
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
FuRongJun-1999/dsh-memory#170 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
pgvector/pgvector-python#163 ·
-
[开源推荐] 打拼音就出篆书的输入法,附古文字创作小工具Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
521xueweihan/HelloGitHub#3940 ·