首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >关闭javapns.Push.combined调试模式

关闭javapns.Push.combined调试模式
EN

Stack Overflow用户
提问于 2014-07-02 22:06:15
回答 1查看 440关注 0票数 0

我使用的是javapns,它工作得很好,但每次它发送通知时,它都会记录下填充到我的日志文件中的所有内容。如何停止记录javapns的活动?这是我的代码

代码语言:javascript
复制
BasicConfigurator.configure();
ArrayList<String> devices = new ArrayList<String>();
devices.add("deviceID");
Push.combined ("Test Notification...", 1, "bingbong.aiff", "ssl_cert.p12", "password",true, devices);

(我已经将生产模式设置为true)。

谢谢

EN

回答 1

Stack Overflow用户

发布于 2014-07-02 22:40:08

JavaPN使用log4j进行日志记录。

您可以使用以下配置文件停止它:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
<log4j:configuration>
 <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
   <layout class="org.apache.log4j.PatternLayout">
     <param name="ConversionPattern" value="%d{ABSOLUTE} 
      %5p %c{1}:%L - %m%n"/>
   </layout>
 </appender>
 <root>
    <priority value="OFF"></priority>
    <appender-ref ref="stdout"/>
 </root>
</log4j:configuration>

<priority value="OFF"></priority>停止所有日志记录。您可以选择以下任何日志记录级别:

代码语言:javascript
复制
  /**
     The <code>OFF</code> has the highest possible rank and is
     intended to turn off logging.  */
  final static public Level OFF = new Level(OFF_INT, "OFF", 0);

  /**
     The <code>FATAL</code> level designates very severe error
     events that will presumably lead the application to abort.
   */
  final static public Level FATAL = new Level(FATAL_INT, "FATAL", 0);

  /**
     The <code>ERROR</code> level designates error events that
     might still allow the application to continue running.  */
  final static public Level ERROR = new Level(ERROR_INT, "ERROR", 3);

  /**
     The <code>WARN</code> level designates potentially harmful situations.
  */
  final static public Level WARN  = new Level(WARN_INT, "WARN",  4);

  /**
     The <code>INFO</code> level designates informational messages
     that highlight the progress of the application at coarse-grained
     level.  */
  final static public Level INFO  = new Level(INFO_INT, "INFO",  6);

  /**
     The <code>DEBUG</code> Level designates fine-grained
     informational events that are most useful to debug an
     application.  */
  final static public Level DEBUG = new Level(DEBUG_INT, "DEBUG", 7);

  /**
    * The <code>TRACE</code> Level designates finer-grained
    * informational events than the <code>DEBUG</code level.
   *  @since 1.2.12
    */
  public static final Level TRACE = new Level(TRACE_INT, "TRACE", 7);


  /**
     The <code>ALL</code> has the lowest possible rank and is intended to
     turn on all logging.  */
  final static public Level ALL = new Level(ALL_INT, "ALL", 7);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24533263

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档