Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/user_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def put(self, user_data, user_id):
class Login(MethodView):
@blp.arguments(UserSchema)
def post(self, user_data):
logger.info(f"User: {user_data['username']} login...")
logger.info(f"User {user_data['username']} is login...")
result = user_service.login_user(user_data)
return result

Expand Down
12 changes: 4 additions & 8 deletions app/utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from datetime import datetime

def configure_logging(app: Flask):
# Set the logging level
logging.basicConfig(level=logging.DEBUG)

# Create a logger instance
logger = logging.getLogger(app.name)

# Set the logging level
logger.setLevel(logging.DEBUG)

# Set the timezone to Vietnam
vietnam_timezone = pytz.timezone('Asia/Ho_Chi_Minh')

Expand All @@ -30,8 +30,4 @@ def configure_logging(app: Flask):
file_handler = logging.FileHandler(filename=app.config['LOG_FILE_API'], encoding="utf-8")
file_handler.setLevel(logging.DEBUG)
file_handler.setFormatter(logging.Formatter(file_log_format, datefmt=app.config['DATE_FMT']))
logger.addHandler(file_handler)

# Disable the INFO log messages from werkzeug
# werkzeug_logger = logging.getLogger('werkzeug')
# werkzeug_logger.setLevel(logging.ERROR) # Set the level to ERROR to turn off INFO messages
logger.addHandler(file_handler)
4 changes: 2 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ class DefaultConfig:
"""
# Flask Configuration
APP_NAME = os.environ.get('APP_NAME')
SECRET_KEY = "e42ebf32a22c7cef7f4a33c71f90f0d8ea65e63144f952e57e1b39b26cc26a6f"
SECRET_KEY = os.environ.get('SECRET_KEY', "e42ebf32a22c7cef7f4a33c71f90f0d8ea65e63144f952e57e1b39b26cc26a6f")
PROPAGATE_EXCEPTIONS = True
DEBUG = False
TESTING = False

# Configuration of Flask-JWT-Extended
JWT_SECRET_KEY = "d7da6e940725de5a15b7e48f5a71f535a315c72a5372c1d3bb8691b38b5f29a1"
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_KEY', "d7da6e940725de5a15b7e48f5a71f535a315c72a5372c1d3bb8691b38b5f29a1")
# Determines the minutes that the access token remains active
JWT_ACCESS_TOKEN_EXPIRES = datetime.timedelta(minutes=30)
# Determines the days that the refresh token remains active
Expand Down