-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogmetrics.html
More file actions
392 lines (376 loc) · 19.1 KB
/
Copy pathlogmetrics.html
File metadata and controls
392 lines (376 loc) · 19.1 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
<!DOCTYPE html>
<html lang="en">
<head>
<title>Devxchange - LogMetrics Framework</title>
<!-- Meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Devxchange - LogMetrics Framework">
<meta name="description"
content="LogMetrics Framework provides simplified configuration to log payload for spring java projects & python projects">
<meta name="keywords"
content="Devxchange,devxchange,devxchange.io,LogMetrics, LogMetrics for Spring Projects, LogMetrics for Python Projects">
<meta name="robots" content="index, follow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="English">
<meta name="revisit-after" content="30 days">
<meta name="author" content="Devxchange.io">
<link rel="shortcut icon" href="favicon.ico">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<!-- FontAwesome JS -->
<script defer src="https://use.fontawesome.com/releases/v5.8.2/js/all.js" integrity="sha384-DJ25uNYET2XCl5ZF++U8eNxPWqcKohUUBUpKGlNLMchM7q4Wjg2CUpjHLaL8yYPH" crossorigin="anonymous"></script>
<!-- Global CSS -->
<link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.min.css">
<!-- Plugins CSS -->
<link rel="stylesheet" href="assets/plugins/prism/prism.css">
<link rel="stylesheet" href="assets/plugins/elegant_font/css/style.css">
<!-- Theme CSS -->
<link id="theme-style" rel="stylesheet" href="assets/css/styles.css">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-154410551-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-154410551-1');
</script>
</head>
<body class="body-green">
<div class="page-wrapper">
<!-- ******Header****** -->
<header id="header" class="header">
<div class="container">
<div class="branding">
<h1 class="logo">
<a href="index.html">
<span aria-hidden="true" class="icon_documents_alt icon"></span>
<span class="text-highlight">DEVXCHANGE.IO</span>
</a>
</h1>
</div><!--//branding-->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">Home</a></li>
<li class="breadcrumb-item active">LogMetrics Framework</li>
</ol>
</div><!--//container-->
</header><!--//header-->
<div class="doc-wrapper">
<div class="container">
<div id="doc-header" class="doc-header text-center">
<h1 class="doc-title"><i class="icon_datareport_alt"></i> LogMetrics Framework</h1>
<div class="meta"><i class="far fa-clock"></i> Last updated: Nov 23th, 2019</div>
</div><!--//doc-header-->
<div class="doc-body row">
<div class="doc-content col-md-9 col-12 order-1">
<div class="content-inner">
<section id="download-section" class="doc-section">
<h2 class="section-title">General</h2>
<div class="section-block">
<p>LogMetrics Framework is used to collect and log the API metrics data and capture
the request and response payload.
</p>
</div>
</section><!--//doc-section-->
<section id="code-section" class="doc-section">
<h2 class="section-title">Java</h2>
<div class="section-block">
<p>LogMetrics provides simplified configuration to log payload for
spring java projects</p>
</div><!--//section-block-->
<div id="repo" class="section-block">
<div class="code-block">
<h6>Repository</h6>
<pre><code class="language-javascript"> maven { url "https://dl.bintray.com/m2/release"}</code></pre>
</div><!--//code-block-->
</div><!--//section-block-->
<div id="dependency" class="section-block">
<div class="code-block">
<h6>Dependency- Gradle</h6>
<pre><code class="language-javascript">compile ("io.devxchange:logmetrics:0.0.2")</code></pre>
</div><!--//code-block-->
</div><!--//section-block-->
<div id="properties" class="section-block">
<div class="code-block">
<h6>properties</h6>
<pre><code class="language-css">logmetrics.logging.enabled=true
logmetrics.logging.request.enabled=true
logmetrics.logging.response.enabled=true
logmetrics.logging.obfuscate.enabled=false
logmetrics.logging.obfuscate.md5.fields= #comma seperated fields
logmetrics.logging.obfuscate.sha256.fields= #comma seperated fields
logmetrics.logging.obfuscate.fields= #comma seperated fields</code></pre>
</div><!--//code-block-->
</div><!--//section-block-->
<div id="appconfig" class="section-block">
<div class="code-block">
<h6>AppConfig</h6>
<pre><code class="language-javascript">@Configuration
@EnableWebMvc
public class AppConfig extends WebMvcConfigurerAdapter
{
@Autowired
@Qualifier("manager.logwriter")
private LogWriterManager logWriterManager;
@Override
public void addInterceptors(InterceptorRegistry registry)
{
registry.addInterceptor(new RestTransactionInterceptor(logWriterManager));
}
} </code></pre>
<h6>SpringApplication</h6>
<pre><code class="language-javascript">import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(basePackages = {"io.devxchange.logmetrics"})
public class LoggingDemoApplication {
public static void main(String[] args) {
SpringApplication.run(LoggingDemoApplication.class, args);
}
}
</code></pre>
</div><!--//code-block-->
</div><!--//section-block-->
<div id="schema" class="section-block">
<div class="code-block">
<h6>Logmetrics Schema</h6>
<pre><code class="language-javascript">
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "LogMetrics",
"properties": {
"Node": {
"type": "string",
"description": "Application Host IP Address"
},
"message_type": {
"type": "string",
"description": "Logmetrics message type",
"value": "LOGMETRICS_MESSAGE"
},
"Duration": {
"type": "integer",
"description": "Response time of the API"
},
"Host": {
"type": "string",
"description": "Application Host Name"
},
"Fault": {
"type": "boolean",
"description": "API Success or Failed status "
},
"Method": {
"type": "string",
"description": "API Method name"
},
"ResponseBody": {
"type": "string",
"description": "API Response Body"
},
"StartDateTime": {
"type": "string",
"description": "API Start Time"
},
"EndDateTime": {
"type": "string",
"description": "API End time"
},
"HttpMethod": {
"type": "string",
"description": "Http Method Type"
},
"RequestBody": {
"type": "string",
"description": "API Request Body"
}
}
}</code></pre></div><!--//code-block-->
</div><!--//section-block-->
<div id="release" class="section-block">
<div class="code-block">
<h6>Release</h6>
<h7>0.0.2</h7>
<pre><code class="language-handlebars">adding request and response payload obfuscation (masking sensitive information)
</code></pre>
<h7>0.0.1</h7>
<pre><code class="language-handlebars">logging rest verb & payload to console.
feature to enable/disable payload logging
</code></pre>
</div><!--//code-block-->
</div><!--//section-block-->
<div id="demo" class="section-block">
<div class="code-block">
<h6>Git Demo Example</h6>
<pre><code class="language-git">$ git clone https://github.com/devxchange-blog/logmetrics-demo.git </code></pre>
</br>
<img src="assets/gifs/logmetrics-demo.gif">
</div><!--//code-block-->
</div><!--//section-block-->
</section><!--//doc-section-->
<section id="python-code-section" class="doc-section">
<h2 class="section-title">Python</h2>
<div class="section-block">
<p>LogMetrics provides simplified configuration to log payload for
python flask projects</p>
</div><!--//section-block-->
<div id="python-install" class="section-block">
<div class="code-block">
<h6>Pypi Module</h6>
<pre><code class="language-javascript">pip install logmetrics-sdk</code></pre>
</div><!--//code-block-->
</div><!--//section-block-->
<div id="python-properties" class="section-block">
<div class="code-block">
<h6>properties</h6>
<pre><code class="language-css">enable_logmetrics= True
enable_frontend_request= True
enable_frontend_response= True
enable_backend= True
enable_backend_request= True
enable_backend_response= True </code></pre>
</div><!--//code-block-->
</div><!--//section-block-->
<div id="python-usage" class="section-block">
<div class="code-block">
<h6>Usage</h6>
<pre><code class="language-javascript">from logmetrics_sdk.logmetrics import LogMetrics
@app.route('/todo/api/v1/tasks', methods=['GET'])
@LogMetrics(enable_logmetrics=True,
enable_frontend_request=True,
enable_frontend_response=True,
enable_backend=True,
enable_backend_request=True,
enable_backend_response=True)
def get_tasks():
return jsonify(tasks)</code></pre>
</div><!--//code-block-->
</div><!--//section-block-->
<div id="python-schema" class="section-block">
<div class="code-block">
<h6>Logmetrics Schema</h6>
<pre><code class="language-javascript">{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "LogMetrics",
"properties": {
"Node": {
"type": "string",
"description": "Application Host IP Address"
},
"MessageType": {
"type": "string",
"description": "Logmetrics message type",
"value": "LOGMETRICS_MESSAGE"
},
"Duration": {
"type": "integer",
"description": "Response time of the API"
},
"Host": {
"type": "string",
"description": "Application Host Name"
},
"Fault": {
"type": "boolean",
"description": "API Success or Failed status "
},
"Method": {
"type": "string",
"description": "API Method name"
},
"ResponseBody": {
"type": "string",
"description": "API Response Body"
},
"StartDateTime": {
"type": "string",
"description": "API Start Time"
},
"EndDateTime": {
"type": "string",
"description": "API End time"
},
"HttpMethod": {
"type": "string",
"description": "Http Method Type"
},
"RequestBody": {
"type": "string",
"description": "API Request Body"
}
}
}</code></pre></div><!--//code-block-->
</div><!--//section-block-->
<div id="python-release" class="section-block">
<div class="code-block">
<h6>Release</h6>
<h7>1.0.3</h7>
<pre><code class="language-handlebars">logging rest verb & payload to console.
feature to enable/disable payload logging
</code></pre></div><!--//code-block-->
</div><!--//section-block-->
<div id="python-demo" class="section-block">
<div class="code-block">
<h6>Git Demo Example</h6>
<pre><code class="language-git">$ git clone https://github.com/devxchange-blog/logmetrics-python-demo.git </code></pre>
</br>
</div><!--//code-block-->
</div><!--//section-block-->
</section><!--//doc-section-->
<section id="go-section" class="doc-section">
<h2 class="section-title">Go</h2>
<div class="section-block">
<p><strong>Development In Progress</strong> - LogMetrics provides simplified
configuration to log payload for Go projects</p>
</div><!--//section-block-->
</section><!--//doc-section-->
</div><!--//content-inner-->
</div><!--//doc-content-->
<div class="doc-sidebar col-md-3 col-12 order-0 d-none d-md-flex">
<div id="doc-nav" class="doc-nav">
<nav id="doc-menu" class="nav doc-menu flex-column sticky">
<a class="nav-link scrollto" href="#download-section">General</a>
<a class="nav-link scrollto" href="#code-section">Java</a>
<nav class="doc-sub-menu nav flex-column">
<a class="nav-link scrollto" href="#repo">Repository</a>
<a class="nav-link scrollto" href="#dependency">Dependency</a>
<a class="nav-link scrollto" href="#properties">Properties</a>
<a class="nav-link scrollto" href="#appconfig">AppConfig</a>
<a class="nav-link scrollto" href="#schema">Schema</a>
<a class="nav-link scrollto" href="#release">Release</a>
<a class="nav-link scrollto" href="#demo">Demo</a>
</nav><!--//nav-->
<a class="nav-link scrollto" href="#python-code-section">Python</a>
<nav class="doc-sub-menu nav flex-column">
<a class="nav-link scrollto" href="#python-install">PyPi Module</a>
<a class="nav-link scrollto" href="#python-properties">Properties</a>
<a class="nav-link scrollto" href="#python-usage">Usage</a>
<a class="nav-link scrollto" href="#python-schema">Schema</a>
<a class="nav-link scrollto" href="#python-release">Release</a>
<a class="nav-link scrollto" href="#python-demo">Demo</a>
</nav><!--//nav-->
<a class="nav-link scrollto" href="#go-section">Go</a>
</nav><!--//doc-menu-->
</div>
</div><!--//doc-sidebar-->
</div><!--//doc-body-->
</div><!--//container-->
</div><!--//doc-wrapper-->
</div><!--//page-wrapper-->
<footer class="footer text-center">
<div class="container">
<small class="copyright">Copyright © 2019 DevXchange.io</small><br>
<small class="copyright">Theme by <a href ="https://themes.3rdwavemedia.com/" target="_blank">3rd
Wave Media</a></small>
</div><!--//container-->
</footer><!--//footer-->
<!-- Main Javascript -->
<script type="text/javascript" src="assets/plugins/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/plugins/prism/prism.js"></script>
<script type="text/javascript" src="assets/plugins/jquery-scrollTo/jquery.scrollTo.min.js"></script>
<script type="text/javascript" src="assets/plugins/stickyfill/dist/stickyfill.min.js"></script>
<script type="text/javascript" src="assets/js/main.js"></script>
</body>
</html>