Skip to content

Commit aeccffb

Browse files
ChrisAubuchonlangston-barrett
authored andcommitted
Send access and error logs to stdout and stderr (#12)
* Set nginx output logs to stdout/stderr * Terminate lines * Remove `set -x` unless DEBUG is set
1 parent db18e29 commit aeccffb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

nginx/nginx.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
worker_processes 1;
2+
error_log /dev/stderr;
23

34
events {
45
worker_connections 1024;
@@ -11,5 +12,7 @@ http {
1112
sendfile on;
1213
keepalive_timeout 65;
1314

15+
access_log /dev/stdout;
16+
1417
include /etc/nginx/conf/*.conf;
1518
}

scripts/nginx-run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
set -x
3+
#set the DEBUG env variable to turn on debugging
4+
[[ -n "$DEBUG" ]] && set -x
45

56
if [ ! -s /etc/nginx/nginx.conf ]; then
67
exit 0

0 commit comments

Comments
 (0)