0

javapns を使用していますが、正常に動作しますが、通知を送信するたびに、ログ ファイルに入力されているすべての情報が記録されます。javapns のアクティビティのログ記録を停止するにはどうすればよいですか? これは私のコードです

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に設定しました)。

ありがとう

4

1 に答える 1

0

JavaPN はログ記録に log4j を使用しました。

この構成ファイルで停止できます:

<?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>すべてのロギングを停止します。次のログ レベルのいずれかを選択できます。

  /**
     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);
于 2014-07-02T14:40:08.333 に答える