Run Server in background with maximum debug to log file

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Run Server in background with maximum debug to log file

Ali Jawad-2
Hi
I am running the server with debug=9 and fork=yes and log standard output = yes. when I do that I can see a lot of debug info and sip packets in the standard output however the log file does show only some notices and xlog entries. So when I close putty and get back later or a few days later I have to kill and restart openser to see debug info as the log file is not showing maximum debug levels unlike the standard output.
 
Please advice, the goal I want to reach is to see maximum loggin in a file so I can check it out without having to restart the server.
 
 
Thanks

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Run Server in background with maximum debug to log file

Wasin Thiengkunagrit
Hi Ali Jawad,

 According to http://top12345tw.blogspot.com/2008/05/openser.html ,
It's explain that when you set "log_stderror=yes" the log will only
print out on standard output. Please try to set "log_stderror=no" and
see if the log was printed into syslog file. Additionally you can
redirect the log result to another file (which is not syslog) by doing
this steps
 1. Set the "log_facility=LOG_LOCAL7"
 2. edit file /etc/syslog.conf  by adding this line to the end of the
file "local7.* /var/log/opensips"
 3. create the initial log file with command "$echo "" > /var/log/opensips"
 4. restart syslog deamon with command "$/etc/init.d/sysklogd restart"
 5. restart your OpenSips again this should log every messages into
/var/log/opensips file

Cheers
Wasin





2009/1/11 Ali Jawad <[hidden email]>:

> Hi
> I am running the server with debug=9 and fork=yes and log standard output =
> yes. when I do that I can see a lot of debug info and sip packets in the
> standard output however the log file does show only some notices and xlog
> entries. So when I close putty and get back later or a few days later I have
> to kill and restart openser to see debug info as the log file is not showing
> maximum debug levels unlike the standard output.
>
> Please advice, the goal I want to reach is to see maximum loggin in a file
> so I can check it out without having to restart the server.
>
>
> Thanks
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Run Server in background with maximum debug to log file

Iñaki Baz Castillo
El Domingo, 11 de Enero de 2009, Wasin Thiengkunagrit escribió:

> Additionally you can
> redirect the log result to another file (which is not syslog) by doing
> this steps
>  1. Set the "log_facility=LOG_LOCAL7"
>  2. edit file /etc/syslog.conf  by adding this line to the end of the
> file "local7.* /var/log/opensips"
>  3. create the initial log file with command "$echo "" > /var/log/opensips"
>  4. restart syslog deamon with command "$/etc/init.d/sysklogd restart"
>  5. restart your OpenSips again this should log every messages into
> /var/log/opensips file

Those steps make OpenSIPS log appearing in /var/log/opensips, but still
remains appearing in /var/log/syslog, at least in Debian Etch following step
by step your explanation.

This is something I've never got (logging OpenSIPS to any file but syslog).

Regards.

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Run Server in background with maximum debug to log file

Wasin Thiengkunagrit
Dear  Iñaki Baz Castillo,

I'm running Opensips on Ubuntu 8.10. And I've found out that the log appear on
both /var/log/syslog and /var/log/opensips. The log messages are
almost the same.
I think that OpenSips forwarding all log to /var/log/opensips and some
of the duplicate messages
to /var/log/syslog.

Wasin



2009/1/11 Iñaki Baz Castillo <[hidden email]>:

> El Domingo, 11 de Enero de 2009, Wasin Thiengkunagrit escribió:
>> Additionally you can
>> redirect the log result to another file (which is not syslog) by doing
>> this steps
>>  1. Set the "log_facility=LOG_LOCAL7"
>>  2. edit file /etc/syslog.conf  by adding this line to the end of the
>> file "local7.* /var/log/opensips"
>>  3. create the initial log file with command "$echo "" > /var/log/opensips"
>>  4. restart syslog deamon with command "$/etc/init.d/sysklogd restart"
>>  5. restart your OpenSips again this should log every messages into
>> /var/log/opensips file
>
> Those steps make OpenSIPS log appearing in /var/log/opensips, but still
> remains appearing in /var/log/syslog, at least in Debian Etch following step
> by step your explanation.
>
> This is something I've never got (logging OpenSIPS to any file but syslog).
>
> Regards.
>
> --
> Iñaki Baz Castillo
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Run Server in background with maximum debug to log file

Richard Revels
Man Pages are your friend.  When you divert opensips messages to  
another logging file or destination you also need to stop them from  
going to the standard messages file.  Here are a couple of pertinent  
entries from a syslog-ng (gentoo) and rsyslog (CentOS) config.  The  
remote destination entries are looking for pkg_memory errors which are  
then forwarded to a syslog instance on a monitoring server.  If you  
are using something like Zenoss or Solarwinds these messages can  
trigger alerts and all that network monitoring type stuff.


syslog-ng.conf

#any message caught by filter local7 goes to file defined as openser-
$YEAR-$MONTH
destination local7 { file( "/var/log/openser-$YEAR-$MONTH" ); };
#send pkg_memory errors to remote syslog
destination zenoss {udp("192.168.0.1" port(514));


#grab messages from opensips and keep them from also going to messages  
file.
filter local7_filter { facility( local7 ); };
filter messages_filter { not facility( local7 ); };

#grab messages dealing with memory
filter f_out_of_pkg_memory { match("out of pkg memory"); };
filter f_pkg_memory_allocation_failure { match("pkg memory allocation  
failure"); };
filter f_no_more_share_memory { match("no more share memory"); };
filter f_out_of_mem { match("out of mem"); };
filter f_no_shm_mem { match("no more shm mem"); };
filter f_no_pkg_mem { match("no more pkg mem"); };

#we've got sources, destinations, and filtered messages.  send them
log { source( src ); filter( local7_filter ); destination( local7 ); };
log { source(src); filter(f_out_of_pkg_memory); destination(zenoss); };
log { source(src); filter(f_pkg_memory_allocation_failure);  
destination(zenoss); };
log { source(src); filter(f_no_shm_mem); destination(zenoss); };
log { source(src); filter(f_no_pkg_mem); destination(zenoss); };
log { source(src); filter(f_no_more_share_memory);  
destination(zenoss); };

rsyslog is somewhat easier to deal with.

rsyslog.conf

#send lots of stuff to messages file but not local7 opensips stuff
*.info;mail.none;authpriv.none;cron.none;local7.none    /var/log/
messages

#log opensips messages to own log
local7.* /var/log/opensips.log

#send some messages to zenoss
:msg, contains, "INFO:core:probe_max_receive_buffer"    @192.168.0.1:514
:msg, contains, "pkg" @192.168.0.1:514

It should be noted that the rsyslog default on Cent uses facility 7  
for boot messages so you will either want to change to a different  
facility in the opensips config or change rsyslog.conf  to use  
something else for boot messages.

Richard





On Jan 11, 2009, at 12:21 AM, Wasin Thiengkunagrit wrote:

> Dear  Iñaki Baz Castillo,
>
> I'm running Opensips on Ubuntu 8.10. And I've found out that the log  
> appear on
> both /var/log/syslog and /var/log/opensips. The log messages are
> almost the same.
> I think that OpenSips forwarding all log to /var/log/opensips and some
> of the duplicate messages
> to /var/log/syslog.
>
> Wasin
>
>
>
> 2009/1/11 Iñaki Baz Castillo <[hidden email]>:
>> El Domingo, 11 de Enero de 2009, Wasin Thiengkunagrit escribió:
>>> Additionally you can
>>> redirect the log result to another file (which is not syslog) by  
>>> doing
>>> this steps
>>> 1. Set the "log_facility=LOG_LOCAL7"
>>> 2. edit file /etc/syslog.conf  by adding this line to the end of the
>>> file "local7.* /var/log/opensips"
>>> 3. create the initial log file with command "$echo "" > /var/log/
>>> opensips"
>>> 4. restart syslog deamon with command "$/etc/init.d/sysklogd  
>>> restart"
>>> 5. restart your OpenSips again this should log every messages into
>>> /var/log/opensips file
>>
>> Those steps make OpenSIPS log appearing in /var/log/opensips, but  
>> still
>> remains appearing in /var/log/syslog, at least in Debian Etch  
>> following step
>> by step your explanation.
>>
>> This is something I've never got (logging OpenSIPS to any file but  
>> syslog).
>>
>> Regards.
>>
>> --
>> Iñaki Baz Castillo
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Run Server in background with maximum debug to log file

Iñaki Baz Castillo
El Domingo, 11 de Enero de 2009, Richard Revels escribió:
> Man Pages are your friend.  When you divert opensips messages to  
> another logging file or destination you also need to stop them from  
> going to the standard messages file.  Here are a couple of pertinent  
> entries from a syslog-ng (gentoo) and rsyslog (CentOS) config.  The  
> remote destination entries are looking for pkg_memory errors which are  
> then forwarded to a syslog instance on a monitoring server.  If you  
> are using something like Zenoss or Solarwinds these messages can  
> trigger alerts and all that network monitoring type stuff.

Great, I will try it. Thanks.

--
Iñaki Baz Castillo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users