Created
March 17, 2023 00:30
-
-
Save MahdiKarimipour/b8eea0d0c676e7649abfc45227b75519 to your computer and use it in GitHub Desktop.
Manual Logging for Pellerex Managed API Service in Python
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
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