Jump to content

Docker: Pipe output of Emby Server to Docker Logs


sydlexius

Recommended Posts

sydlexius

I searched and didn't find anything, so I thought I'd request a modification to your docker logs to continue outputting after the "All entry points have started" message?  Ideally, this could be governed by an environmental variable for those who don't want to worry about their docker logs directory getting blown up.  To be clear, I want to see output from Emby Server logging when I run something like docker logs EmbyServer -f.

Edited by sydlexius
  • Like 4
Link to comment
Share on other sites

sydlexius
20 minutes ago, Luke said:

Hi, yes I suppose an option for this is reasonable.

I know there are probably a few ways, but based on what little research I've done, you could have an environmental variable like OutputLogsToDocker set to 1, and have an additional service called /etc/services.d/emby-logger, where its run script might look like this:

 

#!/usr/bin/with-contenv sh
# Check if OutputLogsToDocker is set to 1
if [ "${OutputLogsToDocker}" = "1" ]; then
    # Tail the log file and output to stdout
    exec tail -F /config/logs/logfiles.txt
else
    # Do not tail the log file; just sleep indefinitely
    # This keeps the service running without doing anything
    exec sleep infinity
fi

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...