imap的日志

最近在做imap的邮件接受。在和邮件服务器通信时,经常要知道

imap的命令,这里提供一种日志打印的方法。

Java Logging API日志级别

OFF 
SEVERE 
WARNING 
INFO 
CONFIG 
FINE 
FINER 
FINEST 
ALL

找到jre中的logging.properties

/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/logging.properties

将 其copy到eclipse中

需要修改的内容

.level= ALL 
java.util.logging.ConsoleHandler.level = ALL 

改成

启动时



附日志

最好: A3 SELECT INBOX

2013-4-24 23:57:31 com.sun.mail.util.LogOutputStream log

最好: * 148 EXISTS

2013-4-24 23:57:31 com.sun.mail.util.LogOutputStream log

最好: * 0 RECENT

2013-4-24 23:57:31 com.sun.mail.util.LogOutputStream log

最好: * OK [UNSEEN 0]

2013-4-24 23:57:31 com.sun.mail.util.LogOutputStream log

最好: * OK [UIDNEXT 558] Predicted next UID.

2013-4-24 23:57:31 com.sun.mail.util.LogOutputStream log

最好: * OK [UIDVALIDITY 2] UIDs valid.

2013-4-24 23:57:31 com.sun.mail.util.LogOutputStream log

最好: * FLAGS (\Answered \Seen \Deleted \Draft)

2013-4-24 23:57:31 com.sun.mail.util.LogOutputStream log

最好: * OK [PERMANENTFLAGS (\Answered \Seen \Deleted \Draft)] Limited.

2013-4-24 23:57:31 com.sun.mail.util.LogOutputStream log

最好: A3 OK [READ-WRITE] SELECT completed

2013-4-24 23:57:31 com.sun.mail.imap.MessageCache <init>

配置: create cache of size 148

2013-4-24 23:57:31 com.sun.mail.util.LogOutputStream log

最好: A4 SEARCH UNSEEN UNANSWERED UNDELETED ALL

2013-4-24 23:57:31 com.sun.mail.util.LogOutputStream log

最好: * SEARCH

2013-4-24 23:57:31 com.sun.mail.util.LogOutputStream log

最好: A4 OK SEARCH completed


=========================================================================================================

整理一下就是:

=========================================================================================================








最好: A3 SELECT INBOX

最好: * 148 EXISTS

最好: * 0 RECENT

最好: * OK [UNSEEN 0]

最好: * OK [UIDNEXT 558] Predicted next UID.

最好: * OK [UIDVALIDITY 2] UIDs valid.

最好: * FLAGS (\Answered \Seen \Deleted \Draft)

最好: * OK [PERMANENTFLAGS (\Answered \Seen \Deleted \Draft)] Limited.

最好: A3 OK [READ-WRITE] SELECT completed

2013-4-24 23:57:31 com.sun.mail.imap.MessageCache <init>

配置: create cache of size 148

最好: A4 SEARCH UNSEEN UNANSWERED UNDELETED ALL

最好: * SEARCH

最好: A4 OK SEARCH completed



你可能感兴趣的:(imap的日志)