Discussion:
[pjsip] how to disable buffering in pjsua log file in linux?
segalion
2017-07-09 07:58:02 UTC
Permalink
I am trying pjsua 2.0 in linux (ubuntu 64 LTS) and I am experienced that
the writing of log file is highly buffered. I need to detect events in real
time from log, and due to this, I have delays for more than 10 seconds and
even uncompleted lines ...

making a "tail -f logfile" can show this easily

In windows the log events are written inmediatly so I can use realtime
events from log files-

Anybody can help me with this? Are there some config parameter in headers
(may be something like PJ_LOG_USE_STACK_BUFFER) to chage this behaviour in
linux?

Anybody know if pjsua 2.6 has better log realtime writting (I have some
patches in 2.0 and I dont want to rewrite again)

And one more... what about OSX?


Thanks again for this amazing software...
Bill Gardner
2017-07-09 14:22:49 UTC
Permalink
If I recall correctly, log file writing is done via stdio and there is
no way in pjsip to configure buffering. There is a commented out line
that flushes the logfile with an advisory not to enable because of the
performance hit. It's obviously not a good idea to flush on every log
entry. It would be pretty easy to run a periodic timer task that flushes
the logfile a few times a second, that may suffice for your needs.

Not sure why you see different behavior on Windows, in my experience the
pjsip log is buffered on all platforms.

Regards,

Bill
Post by segalion
I am trying pjsua 2.0 in linux (ubuntu 64 LTS) and I am experienced
that the writing of log file is highly buffered. I need to detect
events in real time from log, and due to this, I have delays for more
than 10 seconds and even uncompleted lines ...
making a "tail -f logfile" can show this easily
In windows the log events are written inmediatly so I can use realtime
events from log files-
Anybody can help me with this? Are there some config parameter in
headers (may be something like PJ_LOG_USE_STACK_BUFFER) to chage this
behaviour in linux?
Anybody know if pjsua 2.6 has better log realtime writting (I have
some patches in 2.0 and I dont want to rewrite again)
And one more... what about OSX?
Thanks again for this amazing software...
_______________________________________________
Visit our blog: http://blog.pjsip.org
pjsip mailing list
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Loading...