Disable logging for coturn

2,765 views
Skip to first unread message

Nabeel

unread,
Sep 29, 2015, 4:38:09 AM9/29/15
to TURN Server (Open-Source project)
Hi,

I want to disable all logging for coturn, including stdout.  What is the correct way to do this?

Oleg Moskalenko

unread,
Sep 29, 2015, 6:01:15 PM9/29/15
to Nabeel, TURN Server (Open-Source project)
You have several options:

1) Set the log as stdout, and set --no-stdout-log option;
2) Set the log as /dev/null;
3) Set the log as syslog, and use the system tools to manage the syslog.
> --
> You received this message because you are subscribed to the Google Groups
> "TURN Server (Open-Source project)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
> turn-server-project-rfc57...@googlegroups.com.
> To post to this group, send email to
> turn-server-project...@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/turn-server-project-rfc5766-turn-server.
> For more options, visit https://groups.google.com/d/optout.

Nabeel

unread,
Sep 29, 2015, 6:37:21 PM9/29/15
to Oleg Moskalenko, turn-server-project...@googlegroups.com
I tried the first two methods, by setting in the config file:

no-stdout-log  or  --no-stdout-log   and    log-file=stdout

OR

log-file=/dev/null

restarted coturn, then the command 'turnserver' shows: 

0: log file opened: /var/log/turn_11009_2015-09-29.log

and log files are still created in /var/log

Therefore the two methods did not work.

Nabeel

unread,
Sep 29, 2015, 6:38:21 PM9/29/15
to Oleg Moskalenko, turn-server-project...@googlegroups.com
Typo in last Email:

log-file=/dev/null;

Oleg Moskalenko

unread,
Sep 30, 2015, 2:59:51 AM9/30/15
to Nabeel, turn-server-project...@googlegroups.com
You also have to set --simple-log option to disable the log file
'doctoring'. These options together will do what you need:

--log-file /dev/null --simple-log --no-stdout-log

Nabeel

unread,
Oct 1, 2015, 11:33:22 AM10/1/15
to Oleg Moskalenko, turn-server-project...@googlegroups.com
I still can't get this to work.  Please add a config option like "disable-logging=true".  Coturn take a lot of disk space with the countless log files it creates.

Oleg Moskalenko

unread,
Oct 1, 2015, 1:28:24 PM10/1/15
to Nabeel, turn-server-project...@googlegroups.com
usually the log file is required.

The combination of options that I posted works, I tested it.

Nabeel

unread,
Oct 1, 2015, 1:51:07 PM10/1/15
to Oleg Moskalenko, turn-server-project...@googlegroups.com
I deleted all coturn logs in /var/log directory, then in my config file I included the following three lines:

no-stdout-log

log-file=/dev/null   (also tried log-file=/dev/null; with semi-colon)

simple-log


Restarted coturn, then checked /var/log directory and there are two new log files created there: turn_15529_2015-10-01.log  turn_466_2015-10-01.log

Also tried the following in the config file with the double-dash prefix, although I don't think the double-dash is required in the config file:

--no-stdout-log

--log-file=/dev/null   (also tried --log-file=/dev/null; with semi-colon)

--simple-log


But same problem.  I'm using coturn Version 4.4.5.3 'Ardee West' on CentOS 7.

Please let me know what I'm doing wrong?  

Oleg Moskalenko

unread,
Oct 1, 2015, 3:46:56 PM10/1/15
to Nabeel, turn-server-project...@googlegroups.com
You must not use double-dash in the config file. You use double-dash
only when you are setting the command-line options.

I'll test it again and I'll get back to you soon.

Oleg Moskalenko

unread,
Oct 2, 2015, 1:48:39 AM10/2/15
to Nabeel, turn-server-project...@googlegroups.com
OK, I tested that.

I chose a random Linux system - Mint 17.

I ran two tests:

1) First, I configured no-logging in the command line:

$ turnserver ... --log-file /dev/null --simple-log --no-stdout-log

Of course, any logging parameters must be removed from the config file.

I see no output, and no log files are created.

2) Second, I configured it through the config file:

log-file=/dev/null
simple-log
no-stdout-log

This time, before the turnserver was able to read the config file, it
puts some output to the screen and to a log file. But once the config
file has been processed, it stops any output to any log destination.

So, I consider that test a confirmation that everything works as
supposed. If you want absolutely no output and no log file created,
then configure it through the command-line options.

Nabeel

unread,
Oct 3, 2015, 3:45:41 PM10/3/15
to Oleg Moskalenko, turn-server-project...@googlegroups.com
I tested this again on CentOS 7, with both the command line option and the config file option, and neither of them works on this OS.

With the command line option, I removed the logging parameters from the config file; I didn't include the ellipses like in your example (which gives an error), I typed it like this:

$ turnserver --log-file /dev/null --simple-log  --no-stdout-log

I tried this both before and after starting the coturn service.  In both cases, there are two log files created and one of them increases in size with every call relayed.

With the config line option, I added the three parameters as suggested, in the following order as they appear in the config file:

no-stdout-log
log-file=/dev/null
simple-log

After restarting coturn, two new log files are created in /var/log/ and one of them increases in size with every call relayed.

It seems that the method you suggested does not work on CentOS 7.

Oleg Moskalenko

unread,
Oct 3, 2015, 9:34:58 PM10/3/15
to Nabeel, turn-server-project...@googlegroups.com
On Sat, Oct 3, 2015 at 12:45 PM, Nabeel <nabeel...@gmail.com> wrote:
> I tested this again on CentOS 7, with both the command line option and the
> config file option, and neither of them works on this OS.
>
> With the command line option, I removed the logging parameters from the
> config file; I didn't include the ellipses like in your example (which gives
> an error),

"Ellipses" mean "other turnserver options".

> I typed it like this:
>
> $ turnserver --log-file /dev/null --simple-log --no-stdout-log
>
> I tried this both before and after starting the coturn service.

what ?

"coturn service" is exactly the turnserver process. How come you can
try it "before" and "after" the "coturn service" ?

Are you sure that you understand what you are doing ?

> In both
> cases, there are two log files created and one of them increases in size
> with every call relayed.
>
> With the config line option, I added the three parameters as suggested, in
> the following order as they appear in the config file:
>
> no-stdout-log
> log-file=/dev/null
> simple-log
>
> After restarting coturn, two new log files are created in /var/log/ and one
> of them increases in size with every call relayed.
>
> It seems that the method you suggested does not work on CentOS 7.
>

No, that has nothing to do with CentOS7.

Nabeel

unread,
Oct 4, 2015, 4:00:48 AM10/4/15
to Oleg Moskalenko, turn-server-project...@googlegroups.com
On 4 October 2015 at 02:34, Oleg Moskalenko <mom0...@gmail.com> wrote:

what ?

"coturn service" is exactly the turnserver process. How come you can
try it "before" and "after" the "coturn service" ?


I mean I tried it before and after running 'service turnserver start'.  Before running 'service turnserver start', the command 'service turnserver status' shows turnserver is not running (because it was not started or had been stopped with 'service turnserver stop'.  After running 'service turnserver start', the command 'service turnserver status' shows coturn is running. So I tried the command line option you suggested both before and after turnserver has been started with the command 'service turnserver start'. 

Oleg Moskalenko

unread,
Oct 4, 2015, 4:39:14 PM10/4/15
to Nabeel, turn-server-project...@googlegroups.com
I took a fresh CentOS 7 system, installed the binary turnserver
package on it, and I repeated all steps that we are discussing. I have
100% success - I see no log files.

I have no explanation for that. Something is not right in your configuration.

Nabeel

unread,
Oct 4, 2015, 4:58:44 PM10/4/15
to Oleg Moskalenko, turn-server-project...@googlegroups.com
I compiled and installed coturn from source at this link ( http://turnserver.open-sys.org/downloads/v4.4.5.3/turnserver-4.4.5.3.tar.gz ) because attempting to install the binary package complained of unmet dependencies.  If I get the chance I'll try to install the binary package again.

Nabeel

unread,
Oct 4, 2015, 7:24:06 PM10/4/15
to Oleg Moskalenko, turn-server-project...@googlegroups.com
I found the cause of this problem.  

When I checked the currently running processes with 'ps ax' after the service was stopped using 'service turnserver stop', I found that there is still a running process labelled 'turnserver -v'.  For some reason, it was still running the process 'turnserver -v' which I must have tested ages ago, but expected it to stop with the command 'service turnserver stop'.

I killed that process 'turnserver -v' and now both command line and config file options work for disabling logging.

Oleg Moskalenko

unread,
Oct 4, 2015, 7:32:20 PM10/4/15
to Nabeel, turn-server-project...@googlegroups.com
To install the binary package, you have to run the script install.sh
included into the *.tar.gz file. I just verified that it handles the
package dependencies just file, on a fresh CentOS7 system.

I tested the manually compiled version, too, and the logging options
are working fine for me.

Oleg

Oleg Moskalenko

unread,
Oct 4, 2015, 7:34:18 PM10/4/15
to Nabeel, turn-server-project...@googlegroups.com
On Sun, Oct 4, 2015 at 4:24 PM, Nabeel <nabeel...@gmail.com> wrote:
> I found the cause of this problem.
>
> When I checked the currently running processes with 'ps ax' after the
> service was stopped using 'service turnserver stop', I found that there is
> still a running process labelled 'turnserver -v'. For some reason, it was
> still running the process 'turnserver -v' which I must have tested ages ago,
> but expected it to stop with the command 'service turnserver stop'.

yes, I suspected something like that.

The command "service turnserver stop" will stop only the processes
that you started with "service turnserver start". If you started a
turnserver process "manually", then the service command does not know
about that and cannot stop it.
Reply all
Reply to author
Forward
0 new messages