Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4168488
  • 博文数量: 447
  • 博客积分: 1241
  • 博客等级: 中尉
  • 技术积分: 5786
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-27 06:48
个人简介

读好书,交益友

文章分类

全部博文(447)

文章存档

2023年(6)

2022年(29)

2021年(49)

2020年(16)

2019年(15)

2018年(23)

2017年(67)

2016年(42)

2015年(51)

2014年(57)

2013年(52)

2012年(35)

2011年(5)

分类: 网络与安全

2021-03-27 15:05:07

在etc/strongswan.conf文件中,添加如下的filelog
charon {
        install_routes = no
load_modular = yes
plugins {
include strongswan.d/charon/*.conf
}
        filelog {
        charon {
            # path to the log file, specify this as section name in versions prior to 5.7.0
            path = /var/log/charon.log
            # add a timestamp prefix
            time_format = %b %e %T
            # prepend connection name, simplifies grepping
            ike_name = yes
            # overwrite existing files
            append = no
            # increase default loglevel for all daemon subsystems
            default = 4
            # flush each line to disk
            flush_line = yes
        }
        stderr {
            # more detailed loglevel for a specific subsystem, overriding the
            # default loglevel.
            ike = 2
            knl = 3
        }
    }


}
配置的strongswan的日志的格式

default = 2:
定义的是日志的级别,默认日志级别为:-1,0,1,2,3,4,-1是完全没有日志,
0只告诉你建立连接,连接关闭;
1只输出错误提示,
2会输出错误,警告和调试信息;
3会把连接传输的数据也打印;
4则会把密钥内容这些敏感数据也打印。
一般情况下,1或2都可以


 append = no:
是相当你重启strogswan后,是按上次日志写,还是新建一个日志。
因为strogswan的日志太多了,所以用no flush_line = yes:
每产生一行日志,就写入到磁盘一次,防止突然断电,磁盘缓存数据丢失。


阅读(8970) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~