Closed mrhwick closed 2 years ago
@mrhwick Wouldn't this implementation prevent that you see a output on the Docker logs because you pipe it to a file?
You could use the debug flag to see it in docker logs, but if you have another service that wants to watch the output, this places it into a file that can be made accessible to that other service.
@mrhwick I really don't like this is implemented now, wouldn't it be better you did it like this:
${SERVER_DIR}/valheim_server.x86_64 -name "${SRV_NAME}" -port ${GAME_PORT} -world "${WORLD_NAME}" -password "${SRV_PWD}" -public ${PUBLIC} ${GAME_PARAMS} | tee -a ${SERVER_DIR}/${LOG_FILE}
So you have a output in the Docker log and tee also writes the log to a file, but keep in mind you maybe need a routine that deletes the file after a server restart, otherwise the log file can get pretty big quickly.
I also would recommend that you put ${SERVER_DIR}/
in front of ${LOG_FILE}
so it gets written to a directory that's readable from the host and also that the user not had to fiddle with file paths.
@mrhwick now taking a completely different approach, container is now updated, your variables will work just fine that you've created, thank you for the idea.
It does not look like this new version outputs logs to a file.
@mrhwick had to revert the changes since for some users the entire server doesn't work anymore, please give me a few hours and I will update the container so that it respects the option. EDIT: Everything fixed and the container respects the option now.
Hope you have also seen the variable DELETE_LOG, with this the log is deleted every time the container is starting/restarting (this defaults to "true").
Thanks for your help on this one, I'll see if the new version is logging as expected.
If you want to route the valheim server logs to a file, these options will help you to do that.