Skip to content

Commit 16d4c7d

Browse files
authored
Merge pull request #30 from linuxserver/stdout-logging-opt
2 parents dd93498 + a1f77d1 commit 16d4c7d

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pipeline {
3636
CI_PORT='80'
3737
CI_SSL='false'
3838
CI_DELAY='120'
39-
CI_DOCKERENV='TZ=US/Pacific'
39+
CI_DOCKERENV=''
4040
CI_AUTH=''
4141
CI_WEBPATH=''
4242
}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ services:
8686
- PUID=1000
8787
- PGID=1000
8888
- TZ=Etc/UTC
89+
- LOG_TO_STDOUT= #optional
8990
volumes:
9091
- /path/to/syslog-ng/config:/config
9192
- /path/to/log:/var/log #optional
@@ -104,6 +105,7 @@ docker run -d \
104105
-e PUID=1000 \
105106
-e PGID=1000 \
106107
-e TZ=Etc/UTC \
108+
-e LOG_TO_STDOUT= `#optional` \
107109
-p 514:5514/udp \
108110
-p 601:6601/tcp \
109111
-p 6514:6514/tcp \
@@ -125,6 +127,7 @@ Containers are configured using parameters passed at runtime (such as those abov
125127
| `-e PUID=1000` | for UserID - see below for explanation |
126128
| `-e PGID=1000` | for GroupID - see below for explanation |
127129
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
130+
| `-e LOG_TO_STDOUT=` | If set to `true` container will log to stdout, otherwise will log to `/config/log/`. |
128131
| `-v /config` | Stores config and application files |
129132
| `-v /var/log` | Stores logs collected by the syslog-ng service |
130133
| `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). |
@@ -290,6 +293,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
290293

291294
## Versions
292295

296+
* **24.09.24:** - Add opt to log to stdout.
293297
* **24.05.24:** - Rebase to Alpine 3.20.
294298
* **31.01.24:** - Rebase to Alpine 3.19.
295299
* **11.06.23:** - Rebase to Alpine 3.18, deprecate armhf.

jenkins-vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ repo_vars:
2424
- CI_PORT='80'
2525
- CI_SSL='false'
2626
- CI_DELAY='120'
27-
- CI_DOCKERENV='TZ=US/Pacific'
27+
- CI_DOCKERENV=''
2828
- CI_AUTH=''
2929
- CI_WEBPATH=''

readme-vars.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ development_versions: false
1919
# container parameters
2020
common_param_env_vars_enabled: true
2121
param_container_name: "{{ project_name }}"
22+
opt_param_usage_include_env: true
23+
opt_param_env_vars:
24+
- { env_var: "LOG_TO_STDOUT", env_value: "", desc: "If set to `true` container will log to stdout, otherwise will log to `/config/log/`." }
2225
param_usage_include_vols: true
2326
param_volumes:
24-
- { vol_path: "/config", vol_host_path: "/path/to/syslog-ng/config", desc: "Stores config and application files" }
27+
- { vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/config", desc: "Stores config and application files" }
2528
opt_param_usage_include_vols: true
2629
opt_param_volumes:
2730
- { vol_path: "/var/log", vol_host_path: "/path/to/log", desc: "Stores logs collected by the syslog-ng service" }
@@ -44,6 +47,7 @@ app_setup_block: |
4447
4548
# changelog
4649
changelogs:
50+
- { date: "24.09.24:", desc: "Add opt to log to stdout." }
4751
- { date: "24.05.24:", desc: "Rebase to Alpine 3.20." }
4852
- { date: "31.01.24:", desc: "Rebase to Alpine 3.19." }
4953
- { date: "11.06.23:", desc: "Rebase to Alpine 3.18, deprecate armhf." }
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/usr/bin/with-contenv bash
22
# shellcheck shell=bash
33

4-
exec \
5-
s6-setuidgid abc s6-log n30 s10000000 S30000000 T !"gzip -nq9" /config/log/
4+
if [[ "${LOG_TO_STDOUT,,}" == "true" ]]; then
5+
exec \
6+
s6-setuidgid abc s6-log +.* 1
7+
else
8+
exec \
9+
s6-setuidgid abc s6-log n30 s10000000 S30000000 T !"gzip -nq9" /config/log/
10+
fi

0 commit comments

Comments
 (0)