From c71b3a319d51597b26d42de2d80c5e82c23232c8 Mon Sep 17 00:00:00 2001 From: Michael Treacher Date: Tue, 9 May 2017 02:43:26 +1000 Subject: [PATCH] Log the audit logs (#781) --- lemur/logs/service.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lemur/logs/service.py b/lemur/logs/service.py index 18cd5a91..d73c17af 100644 --- a/lemur/logs/service.py +++ b/lemur/logs/service.py @@ -7,6 +7,7 @@ :license: Apache, see LICENSE for more details. .. moduleauthor:: Kevin Glisson """ +from flask import current_app from lemur import database from lemur.logs.models import Log @@ -20,6 +21,7 @@ def create(user, type, certificate=None): :param certificate: :return: """ + current_app.logger.info("[lemur-audit] action: {0}, user: {1}, certificate: {2}.".format(type, user.email, certificate.name)) view = Log(user_id=user.id, log_type=type, certificate_id=certificate.id) database.add(view) database.commit()