Location of log file in Orthanc for Docker

Hello,

In the past, when viewing logs, I do the following:

docker logs -f orthanc

In Orthanc Docker, where is the location of the log file? Specifically, how should one go about clearing out the log file once it becomes large?

Thanks!
Srey

Hello,

I don’t understand the first part of your question: Actually, the “docker logs” mechanism works fine with Orthanc and Docker.

More precisely, if I start Orthanc with the following command (note the “–name” option):

sudo docker run --name orthanc -p 4242:4242 -p 8042:8042 --rm jodogne/orthanc

Orthanc will write its log to stderr, which I can access using your command:

sudo docker logs -f orthanc

Regarding the second part of your question, check out the “–logfile” and “–logdir” command-line options of Orthanc (documentation is available as usual by running “Orthanc --help”).

If using the “–logfile” command-line option with Orthanc >= 1.1.0, you can send a SIGHUP signal to Orthanc, which will flush the log file onto the disk. As with most UNIX services, you can use this SIGHUP mechanism in conjunction with the logrotate standard tool running in a daily cron job to avoid the log growing indefinitely.

HTH,
Sébastien-

Hi,

Thank you for explanation!

For Orthanc Docker, how would I go about using the “–logfile” and “–logdir” command-line options of Orthanc?
More specifically, does Orthanc Docker support these arguments through the docker run command?

Any guidance much appreciated!

For Orthanc Docker, how would I go about using the “–logfile” and “–logdir” command-line options of Orthanc?
More specifically, does Orthanc Docker support these arguments through the docker run command?

Yes, these command-line options are supported, but you’ll have to map the log target folder onto the host computer. For instance:

sudo docker run -v /tmp/OrthancLogs/:/tmp/OrthancLogs/ -p 4242:4242 -p 8042:8042 --rm jodogne/orthanc /etc/init.d --logdir=/tmp/OrthancLogs --verbose

would output the logs in the folder “/tmp/OrthancLogs/” of the host Linux computer.

Sébastien-

Hello,

The --log options is working for me.

As I learn from another post, I had to use /etc/orthanc instead of /etc/init.d in the docker run command in order for custom configuration to load.

Thanks!
Srey Seng