Repository navigation
Expand file tree
/
Copy pathdoc-python.html
More file actions
144 lines (134 loc) · 5.91 KB
/
Copy pathdoc-python.html
File metadata and controls
144 lines (134 loc) · 5.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Python — LogDoc Documentation</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&family=IBM+Plex+Mono&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="page">
<!-- ============ Header ============ -->
<header class="header">
<a class="logo-group" href="index.html">
<svg width="36" height="36" viewBox="0 0 36 36">
<path d="M24.156 1.086 A18 18 0 1 0 35.727 21.126 L27.750 19.719 A9.9 9.9 0 1 1 21.386 8.697 Z" fill="#e35b28"/>
<circle cx="26.5" cy="6.5" r="4.5" fill="#ffffff"/>
</svg>
<span class="logo-text">LogDoc</span>
</a>
<nav class="nav">
<a class="w500" href="index.html">Home</a>
<a class="orange" href="documentation.html">Documentation</a>
<a href="download.html">Download</a>
<a href="docs-configuration.html">Config</a>
<a href="plugins.html">Plugins</a>
<a href="contacts.html">Contacts</a>
</nav>
<div class="header-spacer"></div>
<div class="header-right">
<button class="nav-toggle" type="button" aria-label="Toggle navigation" aria-expanded="false">
<span></span><span></span><span></span>
</button>
<a class="header-cta" href="download.html">Download</a>
</div>
</header>
<!-- ============ Content ============ -->
<main class="langdoc-content">
<span class="langdoc-bc">Documentation > Log Collection > Python</span>
<h1 class="langdoc-title">Collecting logs from Python applications</h1>
<p class="langdoc-desc">The LogDoc Python SDK with support for the standard logging module. Compatible with Django, Flask, FastAPI and other frameworks.</p>
<div class="langdoc-code">
<div class="langdoc-code-header">
<svg class="icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19h8"/><path d="m4 17 6-6-6-6"/></svg>
<span>Terminal — Installation</span>
</div>
<div class="langdoc-code-body">
<pre>$ pip install logdoc-python</pre>
</div>
</div>
<div class="langdoc-code">
<div class="langdoc-code-header">
<svg class="icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19h8"/><path d="m4 17 6-6-6-6"/></svg>
<span>app.py — Integration</span>
</div>
<div class="langdoc-code-body">
<pre>import logging
from logdoc import LogDocHandler
handler = LogDocHandler(
host='logdoc-server',
port=12345
)
handler.setLevel(logging.DEBUG)
logger = logging.getLogger('myapp')
logger.addHandler(handler)
logger.info('Application started',
extra={'service': 'payment'})</pre>
</div>
</div>
<div class="langdoc-notes">
<h2 class="langdoc-notes-title">Highlights</h2>
<div class="langdoc-note"><span class="dot">•</span><span>Asynchronous sending via asyncio for minimal performance impact</span></div>
<div class="langdoc-note"><span class="dot">•</span><span>Automatic context capture: traceback, module name, line number</span></div>
<div class="langdoc-note"><span class="dot">•</span><span>Structured logging support with arbitrary fields</span></div>
</div>
</main>
<!-- ============ Footer ============ -->
<footer class="footer">
<div class="footer-top">
<div class="footer-brand">
<div class="footer-logo-row">
<svg width="28" height="28" viewBox="0 0 28 28">
<path d="M18.788 0.844 A14 14 0 1 0 27.787 16.431 L21.583 15.337 A7.7 7.7 0 1 1 16.634 6.764 Z" fill="#e35b28"/>
<circle cx="20.5" cy="4.5" r="3.5" fill="#ffffff"/>
</svg>
<span class="footer-logo-name">LogDoc</span>
</div>
<p class="footer-desc">Professional log management system for collecting, routing, and analyzing logs at scale.</p>
</div>
<div class="footer-col">
<span class="footer-col-title">Product</span>
<a href="download.html">Download</a>
<a href="docs-getting-started.html">Installation</a>
<a href="docs-configuration.html">Configuration</a>
<a href="versions.html">Versions</a>
<a href="topology.html">Topology</a>
</div>
<div class="footer-col">
<span class="footer-col-title">Documentation</span>
<a href="docs-getting-started.html">Getting Started</a>
<a href="docs-gather.html">Gather</a>
<a href="docs-pipe.html">Pipe</a>
<a href="docs-sink.html">Sink</a>
<a href="docs-view.html">View</a>
</div>
<div class="footer-col">
<span class="footer-col-title">Developers</span>
<a href="docs-plugin-sdk.html">Plugin SDK</a>
<a href="plugins.html">Plugins</a>
<a href="docs-access-control.html">Access Control</a>
<a href="documentation.html">Instructions</a>
</div>
<div class="footer-col">
<span class="footer-col-title">Contact</span>
<a href="mailto:info@logdoc.org">info@logdoc.org</a>
<a href="https://github.com/LogDoc-org" target="_blank" rel="noopener noreferrer">GitHub</a>
</div>
</div>
<div class="footer-divider"></div>
<div class="footer-bottom">
<span>© 2026 LogDoc. All rights reserved.</span>
<div class="footer-bottom-spacer"></div>
<div class="footer-bottom-links">
<a href="privacy.html">Privacy Policy</a>
<a href="terms.html">Terms of Use</a>
</div>
</div>
</footer>
</div>
<script src="js/site.js" defer></script>
</body>
</html>