forked from IBM-Cloud/application-log-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
233 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,4 +103,6 @@ venv.bak/ | |
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.mypy_cache/ | ||
|
||
app-log-analysis copy.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,107 +1,10 @@ | ||
{# index page, providing a form to submit a city name #} | ||
{% extends "base.html" %} | ||
{% block title %}World of Logging{% endblock %} | ||
{% block title %}World of Logging and Monitoring{% endblock %} | ||
{% block content %} | ||
<script type="text/javascript"> | ||
function logMessage() { | ||
var xhttp; | ||
var level = document.forms['custommessage'].elements['level'].value; | ||
var message = document.forms['custommessage'].elements['message'].value; | ||
var csrfmiddlewaretoken = document.forms['custommessage'].elements['csrfmiddlewaretoken'].value; | ||
xhttp = new XMLHttpRequest(); | ||
xhttp.onreadystatechange = function () { | ||
if (xhttp.readyState == XMLHttpRequest.DONE) { | ||
var response = JSON.parse(xhttp.responseText); | ||
document.getElementById("messageResult").style.display = "block"; | ||
document.getElementById("plogmessage").innerHTML = "Logged message: " + response.smsg; | ||
document.getElementById("message").value = ''; | ||
} | ||
}; | ||
xhttp.open('POST', "/logit"); | ||
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | ||
var postVars = 'message=' + message + '&level=' + level + '&csrfmiddlewaretoken=' + csrfmiddlewaretoken; | ||
xhttp.send(postVars); | ||
return false; | ||
} | ||
|
||
function setLogLevel(newLevel) { | ||
var xhttp; | ||
var csrfmiddlewaretoken = document.forms['custommessage'].elements['csrfmiddlewaretoken'].value; | ||
xhttp = new XMLHttpRequest(); | ||
xhttp.onreadystatechange = function () { | ||
if (xhttp.readyState == XMLHttpRequest.DONE) { | ||
document.getElementById("messageResult").style.display = "block"; | ||
document.getElementById("plogmessage").innerHTML = xhttp.responseText; | ||
} | ||
}; | ||
xhttp.open('POST', "/setLogLevel"); | ||
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | ||
var postVars = 'loggerlevel=' + newLevel + '&csrfmiddlewaretoken=' + csrfmiddlewaretoken; | ||
xhttp.send(postVars); | ||
return false; | ||
} | ||
</script> | ||
<h1 class="title"> | ||
Generate, Access and Analyze Application Logs | ||
</h1> | ||
<div class="container"> | ||
<h2 class="subtitle">Log new message</h2> | ||
<p> | ||
<form action="" name="custommessage"> | ||
{% csrf_token %} | ||
<div class="field"> | ||
<label class="label">Message</label> | ||
<div class="control"> | ||
<input class="input" type="text" name="message" id="message" placeholder="log message..."> | ||
</div> | ||
</div> | ||
|
||
<div class="field"> | ||
<label class="label">Message Log Level</label> | ||
<div class="control"> | ||
<div class="select"> | ||
<select name="level"> | ||
<option value="critical">critical</option> | ||
<option value="error">error</option> | ||
<option value="warn">warn</option> | ||
<option value="info" selected="selected">info</option> | ||
<option value="debug">debug</option> | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="field"> | ||
<div class="control"> | ||
<input type="submit" class="button is-link" type="submit" onclick="return logMessage()" value="Log Message"> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
</p> | ||
<p> | ||
<hr> | ||
<h2 class="subtitle">Set Logger Log Level on Server</h2> | ||
<div class="field"> | ||
<div class="control"> | ||
<div class="select"> | ||
<select name="loglevel" onchange="setLogLevel(this.value)"> | ||
<option value="critical">critical</option> | ||
<option value="error">error</option> | ||
<option value="warn" selected="selected">warn</option> | ||
<option value="info">info</option> | ||
<option value="debug">debug</option> | ||
</select> | ||
</div> | ||
</div> | ||
<div class="jumbotron"> | ||
<h1 class="display-4">World of Logging and Monitoring!</h1> | ||
<p class="lead">Click on Logging or Monitoring tab to get started</p> | ||
<hr class="my-4"> | ||
</div> | ||
|
||
</p> | ||
|
||
|
||
<div id = "messageResult" style="display:none;"> | ||
<hr> | ||
<pre id="plogmessage"></pre> {% endblock %} | ||
</div> | ||
|
||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
{% extends "base.html" %} | ||
{% block title %}World of Logging{% endblock %} | ||
{% block content %} | ||
<script type="text/javascript"> | ||
function logMessage() { | ||
document.getElementById("messageResult").style.display = "block"; | ||
document.getElementById("plogmessage").innerHTML = "Running..."; | ||
var xhttp; | ||
var level = document.forms['custommessage'].elements['level'].value; | ||
var message = document.forms['custommessage'].elements['message'].value; | ||
var csrfmiddlewaretoken = document.forms['custommessage'].elements['csrfmiddlewaretoken'].value; | ||
xhttp = new XMLHttpRequest(); | ||
xhttp.onreadystatechange = function () { | ||
if (xhttp.readyState == XMLHttpRequest.DONE) { | ||
var response = JSON.parse(xhttp.responseText); | ||
document.getElementById("messageResult").style.display = "block"; | ||
document.getElementById("plogmessage").innerHTML = "Logged message: " + response.smsg; | ||
document.getElementById("message").value = ''; | ||
} | ||
}; | ||
xhttp.open('POST', "/logit"); | ||
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | ||
var postVars = 'message=' + message + '&level=' + level + '&csrfmiddlewaretoken=' + csrfmiddlewaretoken; | ||
xhttp.send(postVars); | ||
return false; | ||
} | ||
|
||
function setLogLevel(newLevel) { | ||
var xhttp; | ||
var csrfmiddlewaretoken = document.forms['custommessage'].elements['csrfmiddlewaretoken'].value; | ||
xhttp = new XMLHttpRequest(); | ||
xhttp.onreadystatechange = function () { | ||
if (xhttp.readyState == XMLHttpRequest.DONE) { | ||
document.getElementById("messageResult").style.display = "block"; | ||
document.getElementById("plogmessage").innerHTML = xhttp.responseText; | ||
} | ||
}; | ||
xhttp.open('POST', "/setLogLevel"); | ||
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | ||
var postVars = 'loggerlevel=' + newLevel + '&csrfmiddlewaretoken=' + csrfmiddlewaretoken; | ||
xhttp.send(postVars); | ||
return false; | ||
} | ||
</script> | ||
|
||
<h1 class="title"> | ||
Generate, Access and Analyze Application Logs | ||
</h1> | ||
<div class="container"> | ||
<h2 class="subtitle">Log new message</h2> | ||
<p> | ||
<form action="" name="custommessage"> | ||
{% csrf_token %} | ||
<div class="field"> | ||
<label class="label">Message</label> | ||
<div class="control"> | ||
<input class="input" type="text" name="message" id="message" placeholder="log message..."> | ||
</div> | ||
</div> | ||
|
||
<div class="field"> | ||
<label class="label">Message Log Level</label> | ||
<div class="control"> | ||
<div class="select"> | ||
<select name="level"> | ||
<option value="critical">critical</option> | ||
<option value="error">error</option> | ||
<option value="warn">warn</option> | ||
<option value="info" selected="selected">info</option> | ||
<option value="debug">debug</option> | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="field"> | ||
<div class="control"> | ||
<input type="submit" class="button is-link" type="submit" onclick="return logMessage()" value="Log Message"> | ||
</div> | ||
</div> | ||
</form> | ||
</p> | ||
|
||
<p> | ||
<hr> | ||
<h2 class="subtitle">Set Logger Log Level on Server</h2> | ||
<div class="field"> | ||
<div class="control"> | ||
<div class="select"> | ||
<select name="loglevel" onchange="setLogLevel(this.value)"> | ||
<option value="critical">critical</option> | ||
<option value="error">error</option> | ||
<option value="warn" selected="selected">warn</option> | ||
<option value="info">info</option> | ||
<option value="debug">debug</option> | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
</p> | ||
|
||
|
||
<div id = "messageResult" style="display:none;"> | ||
<hr> | ||
<pre id="plogmessage"></pre> | ||
</div> | ||
|
||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{% extends "base.html" %} | ||
{% block title %}World of Monitoring{% endblock %} | ||
{% block content %} | ||
<script type="text/javascript"> | ||
function createMetrics() { | ||
document.getElementById("metricResult").style.display = "block"; | ||
document.getElementById("metricmessage").innerHTML = "Running...."; | ||
var xhttp; | ||
var metriccount = document.forms['metric'].elements['metriccount'].value; | ||
var csrfmiddlewaretoken = document.forms['metric'].elements['csrfmiddlewaretoken'].value; | ||
xhttp = new XMLHttpRequest(); | ||
xhttp.onreadystatechange = function () { | ||
if (xhttp.readyState == XMLHttpRequest.DONE) { | ||
var response = JSON.parse(xhttp.responseText); | ||
document.getElementById("metricResult").style.display = "block"; | ||
document.getElementById("metricmessage").innerHTML = "Result: " + response.status; | ||
} | ||
}; | ||
xhttp.open('POST', "/createMetrics"); | ||
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | ||
var postVars = 'metriccount=' + metriccount + '&csrfmiddlewaretoken=' + csrfmiddlewaretoken; | ||
xhttp.send(postVars); | ||
return false; | ||
} | ||
</script> | ||
|
||
<h1 class="title"> | ||
Generate Metrics | ||
</h1> | ||
<div class="container"> | ||
<h2 class="subtitle">Create Prometheus metrics</h2> | ||
<p> | ||
<form action="" name="metric"> | ||
{% csrf_token %} | ||
<div class="field"> | ||
<label class="label">Number of times to generate metrics (5 seconds delay between each loop)</label> | ||
<div class="control"> | ||
<div class="select"> | ||
<select name="metriccount"> | ||
<option value="5" selected="selected">5</option> | ||
<option value="10">10</option> | ||
<option value="15">15</option> | ||
<option value="20">20</option> | ||
<option value="25">25</option> | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="field"> | ||
<div class="control"> | ||
<input type="submit" class="button is-link" type="submit" onclick="return createMetrics()" value="Create Metrics"> | ||
</div> | ||
</div> | ||
</form> | ||
</p> | ||
|
||
<div id = "metricResult" style="display:none;"> | ||
<hr> | ||
<pre id="metricmessage"></pre> | ||
</div> | ||
|
||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light"> | ||
<a class="navbar-brand" href="/">WoLaM</a> | ||
<div id="navbarNav"> | ||
<ul class="navbar-nav"> | ||
<li class="nav-item {{ logging_page }}"> | ||
<a class="nav-link" href="{% url 'log' %}">Logging</a> | ||
</li> | ||
<li class="nav-item {{ monitoring_page }}"> | ||
<a class="nav-link" href="{% url 'monitor' %}">Monitoring</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
django>=2.0.8 | ||
pytz==2018.5 | ||
prometheus_client>=0.7.1 |