Skip to content

Commit

Permalink
Merge pull request #78 from linuxserver/stdout-logs
Browse files Browse the repository at this point in the history
Allow logging to stdout
  • Loading branch information
drizuid authored Nov 1, 2023
2 parents b9c80f2 + 8ce8b6b commit 542e3f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ opt_param_env_vars:
- {env_var: "USER_PASSWORD", env_value: "password", desc: "Optionally set a sudo password for `linuxserver.io`, the ssh user. If this or `USER_PASSWORD_FILE` are not set but `SUDO_ACCESS` is set to true, the user will have passwordless sudo access."}
- {env_var: "USER_PASSWORD_FILE", env_value: "/path/to/file", desc: "Optionally specify a file that contains the password. This setting supersedes the `USER_PASSWORD` option (works with docker secrets)."}
- {env_var: "USER_NAME", env_value: "linuxserver.io", desc: "Optionally specify a user name (Default:`linuxserver.io`)"}
- {env_var: "LOG_STDOUT", env_value: "", desc: "Set to `true` to log to stdout instead of file."}
# application setup block
app_setup_block_enabled: true
app_setup_block: |
Expand Down
9 changes: 7 additions & 2 deletions root/etc/s6-overlay/s6-rc.d/log-openssh-server/run
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@

USER_NAME=${USER_NAME:-linuxserver.io}

exec \
s6-setuidgid "${USER_NAME}" s6-log n30 s10000000 S30000000 T !"gzip -nq9" /config/logs/openssh
if [[ "${LOG_STDOUT,,}" == "true" ]]; then
exec \
s6-setuidgid "${USER_NAME}" s6-log +.* 1
else
exec \
s6-setuidgid "${USER_NAME}" s6-log n30 s10000000 S30000000 T !"gzip -nq9" /config/logs/openssh
fi

0 comments on commit 542e3f7

Please sign in to comment.