Skip to content

Commit

Permalink
edit logs
Browse files Browse the repository at this point in the history
  • Loading branch information
KlimDos committed Jan 10, 2024
1 parent 7c943e2 commit 7d6071f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
20 changes: 20 additions & 0 deletions gunicorn.conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# import multiprocessing
# import sys
# import logging

bind = "0.0.0.0:5000" # Bind to all available network interfaces






####### =====
#######

# Redirect gunicorn logs to stdout
accesslog = "-"
errorlog = "-"
#loglevel = "info"
# capture_output = True
# logger_class = "gunicorn.glogging.Logger"
#logging.basicConfig(format="%(asctime)s [%(levelname)s] [%(name)s] %(message)s", stream=sys.stdout)


# workers = multiprocessing.cpu_count() * 2 + 1 # Use formula to determine the number of workers
# worker_class = "gthread" # Use threads for concurrency
# threads = multiprocessing.cpu_count() * 2 # Use twice as many threads as there are workers
Expand Down
19 changes: 1 addition & 18 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,9 @@

from logging.config import dictConfig

dictConfig({
'version': 1,
'formatters': {'default': {
'format': '[%(asctime)s] [%(thread)d] %(levelname)s %(name)s - %(message)s',
}},
'handlers': {'wsgi': {
'class': 'logging.StreamHandler',
'stream': 'ext://flask.logging.wsgi_errors_stream',
'formatter': 'default'
}},
'root': {
'level': 'INFO',
'handlers': ['wsgi']
}
})


#load_dotenv()

print(os.environ.get('ARTEFACT_VERSION'))
logging.info(os.environ.get('ARTEFACT_VERSION'))
build = os.environ.get('ARTEFACT_VERSION')
app = Flask(__name__)

Expand Down

0 comments on commit 7d6071f

Please sign in to comment.