Skip to content

Commit

Permalink
Merge pull request #55 from DXS-GROUP/InDev
Browse files Browse the repository at this point in the history
Update logging configuration
  • Loading branch information
Nighty3098 authored Oct 6, 2024
2 parents 778fa9e + f0ead1f commit 04efcde
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 18 deletions.
Binary file modified app/__pycache__/config.cpython-312.pyc
Binary file not shown.
Binary file modified app/__pycache__/routes.cpython-312.pyc
Binary file not shown.
20 changes: 2 additions & 18 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,10 @@
from flask import Flask

home_dir = os.path.expanduser("~")
log_file_path = os.path.join(home_dir, "logs/ServerPanel.log")
log_file_path = os.path.join(home_dir, "logs/SDashPanel.log")

app = Flask(__name__)

app_version = "0.3.6"

dictConfig(
{
"version": 1,
"formatters": {
"default": {
"format": "[%(asctime)s] %(levelname)s in %(module)s: %(message)s",
}
},
"handlers": {
"wsgi": {
"class": "logging.StreamHandler",
"stream": "ext://flask.logging.wsgi_errors_stream",
"formatter": "default",
},
},
}
)
logging.basicConfig(filename=log_file_path, encoding='utf-8', datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INFO, format='%(asctime)s | %(levelname)s | %(name)s | %(threadName)s : %(message)s')
1 change: 1 addition & 0 deletions app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,5 @@ def sleep_server():

@app.errorhandler(404)
def not_found(error):
app.logger.warning("404 PAGE")
return render_template("error.html"), 404
1 change: 1 addition & 0 deletions app/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@

if __name__ == "__main__":
setproctitle("SDash")
app.logger.warning("!!! New User logging in")
app.run(debug=True, host=get_ip_address())

0 comments on commit 04efcde

Please sign in to comment.