René's URL Explorer Experiment


Title: RQ and Logtail/BetterStack issue · Issue #36 · logtail/logtail-python · GitHub

Open Graph Title: RQ and Logtail/BetterStack issue · Issue #36 · logtail/logtail-python

X Title: RQ and Logtail/BetterStack issue · Issue #36 · logtail/logtail-python

Description: Hi! I was having an issue with RQ logs not being picked up by Logtail. Here's my Django setup (sorry for the formatting): settings.py: LOGGING = {'version': 1, 'disable_existing_loggers': False, 'formatters': {'verbose': {'format': '[%(a...

Open Graph Description: Hi! I was having an issue with RQ logs not being picked up by Logtail. Here's my Django setup (sorry for the formatting): settings.py: LOGGING = {'version': 1, 'disable_existing_loggers': False, 'f...

X Description: Hi! I was having an issue with RQ logs not being picked up by Logtail. Here's my Django setup (sorry for the formatting): settings.py: LOGGING = {'version': 1, 'disable_existing_log...

Opengraph URL: https://github.com/logtail/logtail-python/issues/36

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"RQ and Logtail/BetterStack issue","articleBody":"Hi! \n\nI was having an issue with RQ logs not being picked up by Logtail. Here's my Django setup (sorry for the formatting):\n\nsettings.py:\n```python\nLOGGING = {'version': 1,\n 'disable_existing_loggers': False,\n 'formatters': {'verbose': {'format': '[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s',\n   'datefmt': '%d/%b/%Y %H:%M:%S %Z'},\n  'simple': {'format': '%(levelname)s %(message)s'}},\n 'filters': {'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'},\n  'require_debug_true': {'()': 'django.utils.log.RequireDebugTrue'}},\n 'handlers': {\n  'logtail': {'class': 'logtail.LogtailHandler',\n   'source_token': 'xxx',\n   'host': 'https://xxx.betterstackdata.com',\n   'level': 'INFO',\n   'filters': ['require_debug_false']}},\n 'loggers': {'': {'handlers': ['console', 'file', 'logtail'],\n   'level': 'DEBUG'},\n  'django': {'handlers': ['console', 'file', 'logtail'],\n   'level': 'INFO',\n   'propagate': False},\n  'rq': {'handlers': ['console', 'file', 'logtail'],\n   'level': 'DEBUG',\n   'propagate': False},\n  }} \n```\n\ncore/tasks.py:\n\n```\nimport logging\nfrom django_rq import job\n\nlogger = logging.getLogger(__name__)\n\n# An experiment for routing logging via RQ\n@job(\"default\")\ndef log_via_rq(message):\n    from core.rq_workers import log_experiment\n\n    log_experiment()\n    logger.info(f\"📬 Logging via RQ: {message}\")\n```\n\ncore/rq_workers.py:\n\n```\nimport logging\n\ndef log_experiment():\n    logger = logging.getLogger(__name__)\n    logger.info(\"📧 This is a log message inherited by log_via_rq function in core.tasks.py\")\n\n```\n\nThen, in `python manage.py shell`:\n\n```\nIn [1]: from core.tasks import log_via_rq\n\nIn [2]: log_via_rq.delay('hellojsan')\nOut[2]: Job('1bad5e06-219f-49d2-8fc3-e452b36e0769', enqueued_at=datetime.datetime(2026, 3, 23, 8, 11, 54, 858738, tzinfo=datetime.timezone.utc))\n\n```\n\nAnd finally, the output in BetterStack:\n\nHere's BetterStack (couldn't copy formatted):\n\n```\n2026-03-23 09:10:49.407 CET\nmyapp\ninfo\nWorker cc6750f9ea7a429ab37a43f74e8dba85: cleaning registries for queue: default ../.venv/lib/python3.14/site-packages/rq/worker/base.py:434\nrq.worker\n2026-03-23 09:11:54.872 CET\n\nmyapp\ninfo\ndefault: core.tasks.log_via_rq('hellojsan') (1bad5e06-219f-49d2-8fc3-e452b36e0769) ../.venv/lib/python3.14/site-packages/rq/worker/base.py:1095\nrq.worker\n2026-03-23 09:13:03.815 CET\n\nmyapp\ninfo\npikepdf C++ to Python logger bridge initialized ../lib/python3.14/site-packages/pikepdf/__init__.py:13\npikepdf._core\n```\n\nAfter a lot of debugging, I managed to work around it by creating a custom RQ Worker class and assigning that to RQ:\n```\nclass LoggingWorker(Worker):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        logging.getLogger(__name__).info(\"✅ LoggingWorker instantiated\")\n\n    def main_work_horse(self, job, queue):\n        for handler in logging.getLogger().handlers:\n            if isinstance(handler, LogtailHandler):\n                handler.ensure_flush_thread_alive()\n        super().main_work_horse(job, queue)\n\n    def perform_job(self, job, queue):\n        try:\n            return super().perform_job(job, queue)\n        finally:\n            for handler in logging.getLogger().handlers:\n                if isinstance(handler, LogtailHandler):\n                    handler.flush()\n                    if hasattr(handler, \"flush_thread\") and handler.flush_thread is not None:\n                        handler.flush_thread.join(timeout=2)\n\n```\n\nBut, it would be nice if Logtail could handle this. Is there a way?\n\nThanks! (And please let me know if you need more info!)","author":{"url":"https://github.com/mistalaba","@type":"Person","name":"mistalaba"},"datePublished":"2026-03-23T10:42:17Z","url":"https://github.com/logtail/logtail-python/issues/36"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7071f5d5-21b7-a1b1-8679-998ae2641ce4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD42A:13BAA8:1006BA:154637:6AFBAF37
html-safe-nonced6a2e00692a2bebafd8d018d977c53594705580639fbdbd2a8544c1d1bba1497
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDJBOjEzQkFBODoxMDA2QkE6MTU0NjM3OjZBRkJBRjM3IiwidmlzaXRvcl9pZCI6IjIwNjU0MjgzNDI1NTQ0NzIyNDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4319022bfa9e3930223beb400cedacaebfcec1a1a24429ac31c9bad4521bcba3
hovercard-subject-tagissue:4119908568
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/logtail/logtail-python/36/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e8eec28a29a8233b3b8171024af672bfcbcf7a0844fca35daddf5fe849f0c9c1/logtail/logtail-python/issues/36
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e8eec28a29a8233b3b8171024af672bfcbcf7a0844fca35daddf5fe849f0c9c1/logtail/logtail-python/issues/36
og:image:altHi! I was having an issue with RQ logs not being picked up by Logtail. Here's my Django setup (sorry for the formatting): settings.py: LOGGING = {'version': 1, 'disable_existing_loggers': False, 'f...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemistalaba
hostnamegithub.com
expected-hostnamegithub.com
Nonee25fbd830d3e6ad0e8935c105cf4fdc70c593dffcd27bb45b790ae4fece5ea55
turbo-cache-controlno-preview
go-importgithub.com/logtail/logtail-python git https://github.com/logtail/logtail-python.git
octolytics-dimension-user_id78922349
octolytics-dimension-user_loginlogtail
octolytics-dimension-repository_id351343852
octolytics-dimension-repository_nwologtail/logtail-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id351343852
octolytics-dimension-repository_network_root_nwologtail/logtail-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release08c8f17f9d27054a108b8b6254e405de0151f660
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/logtail/logtail-python/issues/36#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flogtail%2Flogtail-python%2Fissues%2F36
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flogtail%2Flogtail-python%2Fissues%2F36
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=logtail%2Flogtail-python
Reloadhttps://github.com/logtail/logtail-python/issues/36
Reloadhttps://github.com/logtail/logtail-python/issues/36
Reloadhttps://github.com/logtail/logtail-python/issues/36
logtailhttps://github.com/logtail
logtail-pythonhttps://github.com/logtail/logtail-python
Codehttps://github.com/logtail/logtail-python
Issues1 (1)https://github.com/logtail/logtail-python/issues
Pull requestshttps://github.com/logtail/logtail-python/pulls
Actionshttps://github.com/logtail/logtail-python/actions
Security and qualityhttps://github.com/logtail/logtail-python/security
Insightshttps://github.com/logtail/logtail-python/pulse
https://github.com/logtail/logtail-python
New issuehttps://github.com/login?return_to=https://github.com/logtail/logtail-python/issues/36
New issuehttps://github.com/login?return_to=https://github.com/logtail/logtail-python/issues/36
RQ and Logtail/BetterStack issuehttps://github.com/logtail/logtail-python/issues/36#top
https://github.com/PetrHeinz
https://github.com/mistalaba
mistalabahttps://github.com/mistalaba
on Mar 23, 2026https://github.com/logtail/logtail-python/issues/36#issue-4119908568
gyfishttps://github.com/gyfis
PetrHeinzhttps://github.com/PetrHeinz
on Sep 21, 2026https://github.com/logtail/logtail-python/issues/36#event-31520896284
https://github.com/PetrHeinz
PetrHeinzhttps://github.com/PetrHeinz
on Sep 25, 2026https://github.com/logtail/logtail-python/issues/36#issuecomment-5833269887
@mistalabahttps://github.com/mistalaba
0.4.1https://github.com/logtail/logtail-python/releases/tag/v0.4.1
0.4.2https://github.com/logtail/logtail-python/releases/tag/v0.4.2
PetrHeinzhttps://github.com/PetrHeinz
completedhttps://github.com/logtail/logtail-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 25, 2026https://github.com/logtail/logtail-python/issues/36#event-31838791683
https://github.com/mistalaba
mistalabahttps://github.com/mistalaba
on Sep 26, 2026https://github.com/logtail/logtail-python/issues/36#issuecomment-5842582917
@PetrHeinzhttps://github.com/PetrHeinz
Sign up for freehttps://github.com/signup?return_to=https://github.com/logtail/logtail-python/issues/36
Sign in to commenthttps://github.com/login?return_to=https://github.com/logtail/logtail-python/issues/36
PetrHeinzhttps://github.com/PetrHeinz
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.