Skip to content

Commit

Permalink
#64 added documentation on running in logging mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bbottema committed Feb 28, 2017
1 parent 22d9580 commit 7cefd9f
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions src/main/webapp/src/app/components/debugging/debugging.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ <h1>Logging & Debugging</h1>

<section class="toc">
<ul>
<li><a simplePageScroll href="#section-debug-mode">Logging emails instead of sending</a></li>
<li><a simplePageScroll href="#section-debug-logging">Enable javax.mail debug logging</a></li>
<li><a simplePageScroll href="#section-mailexception">Catching exceptions</a></li>
<li><a simplePageScroll href="#section-logging">Logging output</a></li>
Expand All @@ -14,6 +15,32 @@ <h1>Logging & Debugging</h1>
</section>


<a href="#section-debug-mode" id="section-debug-mode" class="section-link h2">&sect;</a>
<h2>Logging emails instead of sending</h2>

<section>
<div class="view">
<p>
You can configure the <code>Mailer</code> to log emails instead of sending them.
</p>
<p>
Note: normally emails are always logged on <code>Level.DEBUG</code> level, but in logging mode emails are logged in <code>Level.INFO</code>.
</p>
</div>

<div class="side">
<pre><code>Mailer mailer = new Mailer(...);
mailer.setTransportModeLoggingOnly(true);

mailer.sendMail(email); // <-- this email will be logged but not sent
</code></pre>
or:
<pre><code class="language-properties">simplejavamail.transport.mode.logging.only=true
</code></pre>
</div>
</section>


<a href="#section-debug-logging" id="section-debug-logging" class="section-link h2">&sect;</a>
<h2>Enable javax.mail debug logging</h2>

Expand All @@ -35,6 +62,9 @@ <h2>Enable javax.mail debug logging</h2>
// or
yourSession.setDebug(true);
Mailer mailer = new Mailer(yourSession);
</code></pre>
or:
<pre><code class="language-properties">simplejavamail.javaxmail.debug=true
</code></pre>
</div>
</section>
Expand Down Expand Up @@ -80,7 +110,7 @@ <h2>Logging output</h2>
log4j2</a>.
</p>
<div>
There are three parts of Simple Java Mail that may produce logging:
Aside from the native JavaMail logging, there are three parts of Simple Java Mail that may produce logging:
<ul class="indent">
<li>"org.simplejavamail"</li>
<li>"socks5bridge"</li>
Expand All @@ -92,7 +122,7 @@ <h2>Logging output</h2>
</p>
</div>
<p>
If you wish to know where and how the properties are loaded, you can increase logging for "org.simplejavamail.internal.util.ConfigLoader".
If you wish to know where and how the properties are loaded, you can increase logging for "org.simplejavamail.util.ConfigLoader".
This will tell you which properties are loaded by API and which from config file and which properties are without value.
</p>
<p>
Expand Down

0 comments on commit 7cefd9f

Please sign in to comment.