Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MahdiKarimipour/b8eea0d0c676e7649abfc45227b75519 to your computer and use it in GitHub Desktop.
Save MahdiKarimipour/b8eea0d0c676e7649abfc45227b75519 to your computer and use it in GitHub Desktop.
Manual Logging for Pellerex Managed API Service in Python
from flask import Flask, request
from flask_restful import Resource, Api
from configuration.centralLogging import CentralLogging
logger = CentralLogging()
app = Flask(__name__)
api = Api(app)
class HelloWorld(Resource):
def get(self):
logger.logInfo("An info message from python app")
return {'about': 'Hello world'}
api.add_resource(HelloWorld, '/')
if __name__ == "__main__":
app.run(host="0.0.0.0")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment