0

I'd like to configure log4j in a huge distributed system. There are a lot of JVMs and processes and (as I am only a student) I am new to such a situation. I use JMS Appender, so I need two files: log4j.properties, jndi.properties.

I've tried some ways:

  1. Put these files into src folder
  2. or into src/java
  3. add jvm argument -Dlog4j.configuration=C:\...\log4j.properties

I don't want to set it in code using PropertyConfigurator.configure("path"), because I'd like to not change source code at all.

Are there any other ways to configure log4j? Or maybe I am missing something? I still get a messages

No appenders could be found for logger (some.package.SomeClass). 
Please initialize the log4j system properly.
4

1 に答える 1

0

基本的に、Log4J を構成するには次の方法があります。

  1. あなたのコードを介して
  2. プロパティファイル(使用しようとしているもの)
  3. XML ファイル

JMSアペンダーの特定の構成に関連して私に尋ねていることは、「log4jを構成する一般的な方法」ではありません

これを ActiveMQ で構成する方法の例を次に示します。プロパティ ファイル内の他の JMS 実装の場合、キーはおそらく同じですが、値は異なります。

例 - ActiveMQ で JMS アペンダーを使用する

于 2012-09-10T08:10:22.380 に答える