import os
import logging
from flask import Flask
from flask import jsonify
from flask import request
from db_utility import DatabaseUtility


ROOT_DIR = str(os.path.abspath(os.getcwd()))
format_string = '%(asctime)s %(name)s %(levelname)s %(message)s'

# set default logging (to console)
logging.basicConfig(level=logging.DEBUG, format=format_string)
log = logging.getLogger()
log.info('Starting Access Logger Service')
log.setLevel(logging.DEBUG)

app = Flask(__name__)


@app.route('/status', methods=['GET'])
def get_status():
    return 'Access Logger Service is up and running'


@app.route('/api/v1/hello_world', methods=['GET'])
def get_hello_world():
    db_util.start_hello_world_timer(request.remote_addr)
    return jsonify(message='hello world')


@app.route('/api/v1/hello/<string:name>', methods=['GET'])
def get_hello_name(name):
    db_util.start_hello_name_timer(request.remote_addr, name)
    return jsonify(message='hello ' + name)


@app.route('/api/v1/logs/hello', methods=['GET'])
def get_hello_logs():
    results = db_util.get_hello_name_logs()
    return jsonify(status='ok', data=results)


@app.route('/api/v1/logs/hello_world', methods=['GET'])
def get_hello_world_logs():
    results = db_util.get_hello_world_logs()
    return jsonify(status='ok', data=results)


@app.route('/api/v1/logs', methods=['GET'])
def get_all_logs():
    results = db_util.get_all_logs()
    return jsonify(status='ok', data=results)


db_util = DatabaseUtility()
db_util.initialize_db(app)


if __name__ == "__main__":
    app.run(host='0.0.0.0', debug=True, port=8081)

bed28a140f6ac9d34ae7010044d8edf4930ad885
<mask token>


@app.route('/status', methods=['GET'])
def get_status():
    return 'Access Logger Service is up and running'


@app.route('/api/v1/hello_world', methods=['GET'])
def get_hello_world():
    db_util.start_hello_world_timer(request.remote_addr)
    return jsonify(message='hello world')


<mask token>


@app.route('/api/v1/logs/hello', methods=['GET'])
def get_hello_logs():
    results = db_util.get_hello_name_logs()
    return jsonify(status='ok', data=results)


<mask token>


@app.route('/api/v1/logs', methods=['GET'])
def get_all_logs():
    results = db_util.get_all_logs()
    return jsonify(status='ok', data=results)


<mask token>

<mask token>


@app.route('/status', methods=['GET'])
def get_status():
    return 'Access Logger Service is up and running'


@app.route('/api/v1/hello_world', methods=['GET'])
def get_hello_world():
    db_util.start_hello_world_timer(request.remote_addr)
    return jsonify(message='hello world')


@app.route('/api/v1/hello/<string:name>', methods=['GET'])
def get_hello_name(name):
    db_util.start_hello_name_timer(request.remote_addr, name)
    return jsonify(message='hello ' + name)


@app.route('/api/v1/logs/hello', methods=['GET'])
def get_hello_logs():
    results = db_util.get_hello_name_logs()
    return jsonify(status='ok', data=results)


<mask token>


@app.route('/api/v1/logs', methods=['GET'])
def get_all_logs():
    results = db_util.get_all_logs()
    return jsonify(status='ok', data=results)


<mask token>

<mask token>
logging.basicConfig(level=logging.DEBUG, format=format_string)
<mask token>
log.info('Starting Access Logger Service')
log.setLevel(logging.DEBUG)
<mask token>


@app.route('/status', methods=['GET'])
def get_status():
    return 'Access Logger Service is up and running'


@app.route('/api/v1/hello_world', methods=['GET'])
def get_hello_world():
    db_util.start_hello_world_timer(request.remote_addr)
    return jsonify(message='hello world')


@app.route('/api/v1/hello/<string:name>', methods=['GET'])
def get_hello_name(name):
    db_util.start_hello_name_timer(request.remote_addr, name)
    return jsonify(message='hello ' + name)


@app.route('/api/v1/logs/hello', methods=['GET'])
def get_hello_logs():
    results = db_util.get_hello_name_logs()
    return jsonify(status='ok', data=results)


@app.route('/api/v1/logs/hello_world', methods=['GET'])
def get_hello_world_logs():
    results = db_util.get_hello_world_logs()
    return jsonify(status='ok', data=results)


@app.route('/api/v1/logs', methods=['GET'])
def get_all_logs():
    results = db_util.get_all_logs()
    return jsonify(status='ok', data=results)


<mask token>
db_util.initialize_db(app)
if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True, port=8081)

<mask token>
ROOT_DIR = str(os.path.abspath(os.getcwd()))
format_string = '%(asctime)s %(name)s %(levelname)s %(message)s'
logging.basicConfig(level=logging.DEBUG, format=format_string)
log = logging.getLogger()
log.info('Starting Access Logger Service')
log.setLevel(logging.DEBUG)
app = Flask(__name__)


@app.route('/status', methods=['GET'])
def get_status():
    return 'Access Logger Service is up and running'


@app.route('/api/v1/hello_world', methods=['GET'])
def get_hello_world():
    db_util.start_hello_world_timer(request.remote_addr)
    return jsonify(message='hello world')


@app.route('/api/v1/hello/<string:name>', methods=['GET'])
def get_hello_name(name):
    db_util.start_hello_name_timer(request.remote_addr, name)
    return jsonify(message='hello ' + name)


@app.route('/api/v1/logs/hello', methods=['GET'])
def get_hello_logs():
    results = db_util.get_hello_name_logs()
    return jsonify(status='ok', data=results)


@app.route('/api/v1/logs/hello_world', methods=['GET'])
def get_hello_world_logs():
    results = db_util.get_hello_world_logs()
    return jsonify(status='ok', data=results)


@app.route('/api/v1/logs', methods=['GET'])
def get_all_logs():
    results = db_util.get_all_logs()
    return jsonify(status='ok', data=results)


db_util = DatabaseUtility()
db_util.initialize_db(app)
if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True, port=8081)

import os
import logging
from flask import Flask
from flask import jsonify
from flask import request
from db_utility import DatabaseUtility


ROOT_DIR = str(os.path.abspath(os.getcwd()))
format_string = '%(asctime)s %(name)s %(levelname)s %(message)s'

# set default logging (to console)
logging.basicConfig(level=logging.DEBUG, format=format_string)
log = logging.getLogger()
log.info('Starting Access Logger Service')
log.setLevel(logging.DEBUG)

app = Flask(__name__)


@app.route('/status', methods=['GET'])
def get_status():
    return 'Access Logger Service is up and running'


@app.route('/api/v1/hello_world', methods=['GET'])
def get_hello_world():
    db_util.start_hello_world_timer(request.remote_addr)
    return jsonify(message='hello world')


@app.route('/api/v1/hello/<string:name>', methods=['GET'])
def get_hello_name(name):
    db_util.start_hello_name_timer(request.remote_addr, name)
    return jsonify(message='hello ' + name)


@app.route('/api/v1/logs/hello', methods=['GET'])
def get_hello_logs():
    results = db_util.get_hello_name_logs()
    return jsonify(status='ok', data=results)


@app.route('/api/v1/logs/hello_world', methods=['GET'])
def get_hello_world_logs():
    results = db_util.get_hello_world_logs()
    return jsonify(status='ok', data=results)


@app.route('/api/v1/logs', methods=['GET'])
def get_all_logs():
    results = db_util.get_all_logs()
    return jsonify(status='ok', data=results)


db_util = DatabaseUtility()
db_util.initialize_db(app)


if __name__ == "__main__":
    app.run(host='0.0.0.0', debug=True, port=8081)
