Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏

170.11. logfile.conf.xml

freeswitch 有多处日志配置,比较分散

170.11.1. 控制台日志配置

			
[root@testing freeswitch]# grep loglevel vars.xml
  <X-PRE-PROCESS cmd="set" data="console_loglevel=err"/>	
			
			

170.11.2. 日志文件配置

logfile.conf.xml

			
[root@netkiller ~]# cat /etc/freeswitch/autoload_configs/logfile.conf.xml 
<configuration name="logfile.conf" description="File Logging">
  <settings>
   <!-- true to auto rotate on HUP, false to open/close -->
   <param name="rotate-on-hup" value="true"/>
  </settings>
  <profiles>
    <profile name="default">
      <settings>
        <!-- File to log to -->
        <!--<param name="logfile" value="/var/log/freeswitch.log"/>-->
        <!-- At this length in bytes rotate the log file (0 for never) -->
        <param name="rollover" value="1048576000"/>
                <!-- Maximum number of log files to keep before wrapping -->
                <!-- If this parameter is enabled, the log filenames will not include a date stamp -->
                <param name="maximum-rotate" value="32"/>
        <!-- Prefix all log lines by the session's uuid  -->
        <param name="uuid" value="true" />
      </settings>
      <mappings>
        <!-- 
             name can be a file name, function name or 'all' 
             value is one or more of debug,info,notice,warning,err,crit,alert,all
             Please see comments in console.conf.xml for more information
        -->
        <map name="all" value="console,debug,info,notice,warning,err,crit,alert"/>
      </mappings>
    </profile>
  </profiles>
</configuration>			
			
			

170.11.3. sofia.conf.xml 日志级别配置

出现大量登录日志,没几天磁盘满了

			
2026-02-23 04:35:28.264784 95.50% [WARNING] sofia_reg.c:3210 Can't find user [44@pbx.netkiller.cn] from 103.195.101.98
You must define a domain called 'pbx.netkiller.cn' in your directory and add a user with the id="44" attribute
			
			

配置下面日志级别禁止输出日志

			
[root@testing freeswitch]# grep log  autoload_configs/sofia.conf.xml 
    <param name="log-level" value="4"/>			
			
			

170.11.4. switch.conf.xml 日志配置

autoload_configs\switch.conf.xml文件中控制着所有的日志输出级别

			
<!-- Default Global Log Level - value is one of debug,info,notice,warning,err,crit,alert -->
<param name="loglevel" value="debug"/>