Skip to content

Commit 1d302e8

Browse files
committed
add logging to file for content alert manager request
1 parent 57bc909 commit 1d302e8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

flaskAlert.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
def postAlertmanager():
2020

2121
content = json.loads(request.get_data())
22-
print(content)
22+
with open("Output.txt", "w") as text_file:
23+
text_file.write("{0}".format(content))
2324
try:
2425

2526
for alert in content['alerts']:
@@ -46,5 +47,5 @@ def postAlertmanager():
4647
return "Alert nOK", 200
4748

4849
if __name__ == '__main__':
49-
logging.basicConfig(filename='flaskAlert.log',level=logging.DEBUG)
50+
logging.basicConfig(filename='flaskAlert.log',level=logging.INFO)
5051
app.run(host='0.0.0.0', port=9119)

0 commit comments

Comments
 (0)