mail-api icon indicating copy to clipboard operation
mail-api copied to clipboard

enable changing log level on a per-connection basis

Open glassfishrobot opened this issue 9 years ago • 5 comments

There does not appear to be a way to change the log level or to suspend debug tracing for a single client connection. There are a few workarounds for this, like writing a custom toggleable PrintStream and passing it to Session.setDebugOut(), but it seems like it'd be significantly cleaner to have a Store API (or something similar).

There is a Protocol.suspendTracing method which temporarily turns off protocol trace output, but it's not visible by user code.

Affected Versions

1.5.3

Environment

Macintosh Mac OS

glassfishrobot avatar May 15 '15 17:05 glassfishrobot

  • Issue Imported From: https://github.com/javaee/javamail/issues/161
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: @bshannon

glassfishrobot avatar Sep 10 '18 06:09 glassfishrobot

@glassfishrobot Commented @bshannon said: Logging is done by many classes at many levels. They all use a MailLogger class, which can log to both the Session's debug stream, and to java.util.logging. The Session's debug stream and flag are captured when the MailLogger is created, which is typically when the class that uses it is instantiated. This doesn't allow for an easy way to control logging based on a Store-level flag.

The workaround you suggest is significantly simpler than the alternatives in JavaMail itself.

I'm most likely going to close this as "won't fix".

glassfishrobot avatar Nov 19 '16 01:11 glassfishrobot

@glassfishrobot Commented Jason-Mehrens said: The SO thread for this is:

http://stackoverflow.com/questions/30201743/how-to-temporarily-disable-protocol-tracing-during-a-javamail-imap-connection/

glassfishrobot avatar Nov 21 '16 15:11 glassfishrobot

@glassfishrobot Commented Reported by dkarp

glassfishrobot avatar May 15 '15 17:05 glassfishrobot

@glassfishrobot Commented This issue was imported from Bugzilla JAVAMAIL-6827

glassfishrobot avatar May 02 '17 07:05 glassfishrobot