除了启用日志记录时通常提供的基本信息之外,您还可以通过设置 MTA 选项文件中的各种 LOG_* MTA 选项来指定要包含的其他可选信息字段。IMTA 调整文件 (msg-svr-base/config/imta_tailor) 中的 IMTA_OPTION_FILE 选项指定的文件将指定 MTA 选项文件。默认情况下,该文件为 msg-svr-base /config/option.dat 文件。
有关 MTA 选项文件的完整详细信息,请参见《Sun Java System Messaging Server 6.3 Administration Reference》中的“Option File”。
本节包含以下几个部分:
编辑 MTA 选项文件。
将 LOG_MESSAGES_SYSLOG 选项设置为 1。
0 值将禁用系统日志通知的生成。非 0 值将启用系统日志通知的生成,其绝对值控制系统日志优先级和工具掩码。(正值表示系统日志通知和常规 mail.log* 条目;负值(不推荐使用)只表示系统日志通知,而禁用常规 mail.log* 条目。)0 值为默认值并表示未执行系统日志(事件日志)记录。
编辑 MTA option.dat 文件。
设置 LOG_FORMAT 选项。
1(默认值)为标准格式。
2 要求为非空格式:空地址字段转换为字符串 "<>"
3 要求为计数格式:所有变量长度字段都以 N 开头,其中 N 是字段中字符数的计数。
4 导致以 XML 兼容的格式写入日志条目。入口日志条目显示为包含多个属性且没有子元素的单个 XML 元素。这三个元素当前被定义为:en 用于入队/出队条目、co 用于连接条目、he 用于标题条目。
入队/出队 (en) 元素可以具有以下属性:
ts - time stamp (always present) no - node name (present if LOG_NODE=1) pi - process id (present if LOG_PROCESS=1) sc - source channel (always present) dc - destination channel (always present) ac - action (always present) sz - size (always present) so - source address (always present) od - original destination address (always present) de - destination address (always present) rf - recipient flags (present if LOG_NOTARY=1) fi - filename (present if LOG_FILENAME=1) ei - envelope id (present if LOG_ENVELOPE_ID=1) mi - message id (present if LOG_MESSAGE_ID=1) us - username (present if LOG_USERNAME=1) ss - source system (present if bit 0 of LOG_CONNECTION is set and source system information is available) se - sensitivity (present if LOG_SENSITIVITY=1) pr - priority (present if LOG_PRIORITY=1) in - intermediate address (present if LOG_INTERMEDIATE=1) ia - initial address (present if bit 0 of LOG_INTERMEDIATE is set and intermediate address information is available) fl - filter (present if LOG_FILTER=1 and filter information is available) re - reason (present if LOG_REASON=1 and reason string is set) di - diagnostic (present if diagnostic info available) tr - transport information (present if bit 5 of LOG_CONNECTION is set and transport information is available) ap - application information (present if bit 6 of LOG_CONNECTION is set and application information is available) qt - the amount of time a message has spent in the queue (LOG_QUEUE_TIME=1) |
下面是一个样例 en 条目:
<en ts="2004-12-08T00:40:26.70" pi="0d3730.10.43" sc="tcp_local" dc="l" ac="E" sz="12" so="info-E8944AE8D033CB92C2241E@whittlesong.com" od="rfc822;ned+2Bcharsets@mauve.sun.com" de="ned+charsets@mauve.sun.com" rf="22" fi="/path/ZZ01LI4XPX0DTM00IKA8.00" ei="01LI4XPQR2EU00IKA8@mauve.sun.com" mi="<11a3b401c4dd01$7c1c1ee0$1906fad0@elara>" us="" ss="elara.whittlesong.com ([208.250.6.25])" in="ned+charsets@mauve.sun.com" ia="ietf-charsets@innosoft.com" fl="spamfilter1:rvLiXh158xWdQKa9iJ0d7Q==, addheader, keep"/> |
请注意,为了清晰起见,该条目进行了换行,实际日志文件条目总是以单行显示的。
连接 (co) 条目可以具有以下属性:
ts - time stamp (always present, also used in en entries) no - node name (present if LOG_NODE=1, also used in en entries) pi - process id (present if LOG_PROCESS=1, also used in en entries) sc - source channel (always present, also used in en entries) dr - direction (always present) ac - action (always present, also used in en entries) tr - transport information (always present, also used in en entries) ap - application information (always present, also used in en entries) mi - message id (present only if message id info available, also used in en entries) us - username (present only if username information available, also used in en entries) di - diagnostic (present only if diagnostic information available, also used in en entries) ct - the amount of time a message has spent in the queue (LOG_QUEUE_TIME=1, also used in en entries) |
下面是一个 co 条目示例:
<co ts="2004-12-08T00:38:28.41" pi="1074b3.61.281" sc="tcp_local" dr="+" ac="O" tr="TCP|209.55.107.55|25|209.55.107.104|33469" ap="SMTP"/> |
标题 (he) 条目具有以下属性:
ts - time stamp (always present, also used in en entries) no - node name (present if LOG_NODE=1, also used in en entries) pi - process id (present if LOG_PROCESS=1, also used in en entries) va - header line value (always present) |
下面是一个 he 条目示例:
<he ts="2004-12-08T00:38:31.41" pi="1074b3.61.281" va="Subject: foo"/> |
编辑 MTA 选项文件。
该选项记录邮件在队列中花费的时间。队列时间记录为一个整数值(以秒为单位)。在非 XML 格式日志中,该值紧接应用程序信息字符串之后显示。在 XML 格式日志中,该值的属性名为 qt。
编辑 MTA 选项文件。
此选项可使 MTA 记录 TCP/IP 连接以及邮件通信流量。默认情况下,系统将连接日志条目写入 mail.log* 文件。也可以将连接日志条目写入 connection.log* 文件。有关详细信息,请参见 SEPARATE_CONNECTION_LOG 选项。
编辑 MTA 选项文件。
将 SEPARATE_CONNECTION_LOG 选项设置为 1。
使用此选项来指定将连接日志条目改写入 connection.log 文件中。默认值 0 将导致连接日志记录存储在 MTA 日志文件中。