Skip to content

Commit

Permalink
improve logging & performance
Browse files Browse the repository at this point in the history
  • Loading branch information
phoehnel committed Jan 9, 2022
1 parent a705b6d commit d596408
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ events {
}

http {
access_log /dev/stdout;
log_format custom '[$time_iso8601] - $remote_addr - $request - $status - $http_referer';
access_log /dev/stdout custom;
error_log /dev/stdout;


sendfile on;
tcp_nopush on;
Expand Down
2 changes: 1 addition & 1 deletion rest-light.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setup_logging():

handler = logging.StreamHandler(sys.stdout)
handler.setLevel(log_level)
formatter = logging.Formatter('[%(asctime)s] - %(levelname)s: %(message)s')
formatter = logging.Formatter('[%(asctime)s ] - %(levelname)s: %(message)s')
handler.setFormatter(formatter)
root.addHandler(handler)

Expand Down
6 changes: 4 additions & 2 deletions uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ uid = www-data
gid = www-data
base = /opt/rest-light
chdir = %(base)
log-date = [%%Y-%%m-%%d %%H:%%M:%%S ]
log-date = [%%Y-%%m-%%d %%H:%%M:%%S ]
disable-logging = true

processes = 1
processes = 3
threads = 3
socket = /tmp/uwsgi.socket

0 comments on commit d596408

Please sign in to comment.