1. <small id='opKls'></small><noframes id='opKls'>

      <i id='opKls'><tr id='opKls'><dt id='opKls'><q id='opKls'><span id='opKls'><b id='opKls'><form id='opKls'><ins id='opKls'></ins><ul id='opKls'></ul><sub id='opKls'></sub></form><legend id='opKls'></legend><bdo id='opKls'><pre id='opKls'><center id='opKls'></center></pre></bdo></b><th id='opKls'></th></span></q></dt></tr></i><div id='opKls'><tfoot id='opKls'></tfoot><dl id='opKls'><fieldset id='opKls'></fieldset></dl></div>
    2. <legend id='opKls'><style id='opKls'><dir id='opKls'><q id='opKls'></q></dir></style></legend>
        <bdo id='opKls'></bdo><ul id='opKls'></ul>

      1. <tfoot id='opKls'></tfoot>

        在 log4j 中配置 SMTPAppender 的正确方法是什么?

        What is the proper way to configure SMTPAppender in log4j?(在 log4j 中配置 SMTPAppender 的正确方法是什么?)
      2. <i id='n5jvf'><tr id='n5jvf'><dt id='n5jvf'><q id='n5jvf'><span id='n5jvf'><b id='n5jvf'><form id='n5jvf'><ins id='n5jvf'></ins><ul id='n5jvf'></ul><sub id='n5jvf'></sub></form><legend id='n5jvf'></legend><bdo id='n5jvf'><pre id='n5jvf'><center id='n5jvf'></center></pre></bdo></b><th id='n5jvf'></th></span></q></dt></tr></i><div id='n5jvf'><tfoot id='n5jvf'></tfoot><dl id='n5jvf'><fieldset id='n5jvf'></fieldset></dl></div>

            • <tfoot id='n5jvf'></tfoot>
                <tbody id='n5jvf'></tbody>

              <small id='n5jvf'></small><noframes id='n5jvf'>

              <legend id='n5jvf'><style id='n5jvf'><dir id='n5jvf'><q id='n5jvf'></q></dir></style></legend>
                  <bdo id='n5jvf'></bdo><ul id='n5jvf'></ul>
                • 本文介绍了在 log4j 中配置 SMTPAppender 的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试将 log4j 配置为使用 SMTPAppender,但我不断收到中继访问被拒绝错误.在我的笔记本电脑上和直接从我的共享托管环境中执行我的代码时,我收到了这个错误.

                  I'm trying to configure log4j to use the SMTPAppender but I keep getting relay access denied errors. I get this error when executing my code on my laptop AND straight from my shared hosting environment.

                  以下是相关配置:

                  #CONFIGURE SMTP
                  log4j.appender.email=org.apache.log4j.net.SMTPAppender
                  log4j.appender.email.SMTPHost=mydomain.com
                  log4j.appender.email.SMTPUsername=myuser
                  log4j.appender.email.SMTPPassword=mypw
                  log4j.appender.email.From=myuser@mydomain.com
                  log4j.appender.email.BufferSize=1
                  log4j.appender.email.EvaluatorClass=TriggerLogEvent
                  log4j.appender.email.layout=org.apache.log4j.PatternLayout
                  log4j.appender.email.layout.ConversionPattern=%m
                  

                  如果我改用 log4j.appender.email.SMTPHost=mail.mydomain.com,则会收到身份验证错误.如果有人使用 DreamHost 电子邮件帐户设置了 log4j SMTPAppender,我的主机是在 DreamHost 上的.

                  If I switch to log4j.appender.email.SMTPHost=mail.mydomain.com instead then I get authentication errors. My hosting is on DreamHost so bonus points if anyone has set up log4j SMTPAppender using a DreamHost email account.

                  推荐答案

                  原来我只是把属性都弄错了.应该是:

                  Turns out I just had the properties all wrong. Should be:

                  #CONFIGURE SMTP
                  log4j.appender.email=org.apache.log4j.net.SMTPAppender
                  log4j.appender.email.SMTPHost=mail.mydomain.com
                  log4j.appender.email.SMTPUsername=myuser@mydomain.com
                  log4j.appender.email.SMTPPassword=mypw
                  log4j.appender.email.From=myuser@mydomain.com
                  log4j.appender.email.BufferSize=1
                  log4j.appender.email.EvaluatorClass=TriggerLogEvent
                  log4j.appender.email.layout=org.apache.log4j.PatternLayout
                  log4j.appender.email.layout.ConversionPattern=%m
                  

                  这篇关于在 log4j 中配置 SMTPAppender 的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Compiling C++ for the JVM(为 JVM 编译 C++)
                  Compile to java bytecode (without using Java)(编译成java字节码(不使用Java))
                  How to drive C#, C++ or Java compiler to compute 1+2+3+...+1000 at compile time?(如何在编译时驱动 C#、C++ 或 Java 编译器计算 1+2+3+...+1000?)
                  Java ClassLoader: load same class twice(Java ClassLoader:两次加载相同的类)
                  How to debug .class files in ECLIPSE?(如何在 ECLIPSE 中调试 .class 文件?)
                  Java quot;The blank final field may not have been initializedquot; Anonymous Interface vs Lambda Expression(Java“可能尚未初始化空白的最终字段匿名接口与 Lambda 表达式)
                  • <tfoot id='aCXcm'></tfoot>
                    <legend id='aCXcm'><style id='aCXcm'><dir id='aCXcm'><q id='aCXcm'></q></dir></style></legend>
                    <i id='aCXcm'><tr id='aCXcm'><dt id='aCXcm'><q id='aCXcm'><span id='aCXcm'><b id='aCXcm'><form id='aCXcm'><ins id='aCXcm'></ins><ul id='aCXcm'></ul><sub id='aCXcm'></sub></form><legend id='aCXcm'></legend><bdo id='aCXcm'><pre id='aCXcm'><center id='aCXcm'></center></pre></bdo></b><th id='aCXcm'></th></span></q></dt></tr></i><div id='aCXcm'><tfoot id='aCXcm'></tfoot><dl id='aCXcm'><fieldset id='aCXcm'></fieldset></dl></div>

                        • <bdo id='aCXcm'></bdo><ul id='aCXcm'></ul>

                          <small id='aCXcm'></small><noframes id='aCXcm'>

                            <tbody id='aCXcm'></tbody>