- Building Telephony Systems with OpenSIPS(Second Edition)
- Flavio E. Goncalves Bogdan-Andrei Iancu
- 286字
- 2021-08-20 10:43:16
Working with the log files
The initialization log can be seen at syslog (/var/log/syslog
). You can redirect the log to a specific file such as opensips.log
by changing the configuration of the rsyslog daemon. By default, OpenSIPS logs to the LOCAL_0
facility as defined in the opensips.cfg
script:
log_facility=LOG_LOCAL0
To redirect log files to opensips.log
, edit the /etc/rsyslog.conf
file and add the following line to the rules section:
Local0.* -/var/log/opensips.log
Create the file and restart the daemon using the following command:
touch /var/log/opensips.log /etc/init.d/rsyslog restart
After restarting OpenSIPS, you should see the following log. Logs are very important for this training. Whenever you have a problem, you should check the log files. You can see the log file in real time using the following command:
tail /var/log/opensips.log –f
You can also change the log level to a more or less verbose level dynamically:
opensipsctl fifo debug 3
A log example is shown here (with some lines suppressed):
tail /var/log/opensips.log –n 100 Dec 22 10:26:02 bookosips opensips: INFO:core:shm_mem_init: allocating SHM block Dec 22 10:26:02 bookosips opensips: INFO:core:fix_poll_method: using epoll_lt as the IO watch method (auto detected) Dec 22 10:26:02 bookosips /usr/local/sbin/opensips[22427]: NOTICE:core:main: version: opensips 2.1.0dev-tls (i386/linux) Dec 22 10:26:02 bookosips /usr/local/sbin/opensips[22427]: INFO:core:main: using 128 Mb shared memory Dec 22 10:26:02 bookosips /usr/local/sbin/opensips[22427]: … … Dec 22 10:26:02 bookosips /usr/local/sbin/opensips[22427]: INFO:usrloc:ul_init_locks: locks array size 512 Dec 22 10:26:02 bookosips /usr/local/sbin/opensips[22427]: INFO:core:probe_max_sock_buff: using rcv buffer of 320 kb Dec 22 10:26:02 bookosips /usr/local/sbin/opensips[22427]: INFO:core:probe_max_sock_buff: using snd buffer of 320 kb Dec 22 10:26:02 bookosips /usr/local/sbin/opensips[22427]: INFO:core:init_sock_keepalive: -- TCP keepalive enabled on socket Dec 22 10:26:02 bookosips opensips: INFO:core:daemonize: pre-daemon process exiting with 0 Dec 22 10:26:02 bookosips /usr/local/sbin/opensips[22439]: INFO:core:init_io_wait: using epoll_lt as the io watch method (auto detected)
- Oracle WebLogic Server 12c:First Look
- Mastering AWS Lambda
- 自然語(yǔ)言處理實(shí)戰(zhàn):預(yù)訓(xùn)練模型應(yīng)用及其產(chǎn)品化
- Effective C#:改善C#代碼的50個(gè)有效方法(原書(shū)第3版)
- Python從小白到大牛
- Oracle 12c中文版數(shù)據(jù)庫(kù)管理、應(yīng)用與開(kāi)發(fā)實(shí)踐教程 (清華電腦學(xué)堂)
- Swift 3 New Features
- Podman實(shí)戰(zhàn)
- Mastering LibGDX Game Development
- 劍指Java:核心原理與應(yīng)用實(shí)踐
- Learning OpenStack Networking(Neutron)(Second Edition)
- Python算法指南:程序員經(jīng)典算法分析與實(shí)現(xiàn)
- Kubernetes源碼剖析
- Red Hat Enterprise Linux Troubleshooting Guide
- 物聯(lián)網(wǎng)系統(tǒng)架構(gòu)設(shè)計(jì)與邊緣計(jì)算(原書(shū)第2版)