要件に応じて、所定のコンポーネントによって記録されたメッセージを切り分けるために、別のログファイルを作成できます。それには、以下のタスクを実行します。 使用しているサーバーの CRX DE Lite に移動します。通常は、http://<server>:<port>/crxde です。
設定フォルダーがない場合は、プロジェクト用の設定フォルダーを作成します(/apps/<component-name>/config など)。
/apps/<component-name>/config の下に、以下のように新しいロガー設定用のノードを作成します。 Name: org.apache.sling.commons.log.LogManager.factory.config-<identifier> (as this is a Logger)
where <identifier> is replaced by free text that you (must) enter to identify the instance (you cannot omit this information). For example, org.apache.sling.commons.log.LogManager.factory.config-ACM
Type: sling:OsgiConfig
上記の Logger ノードに以下のプロパティを設定します。
Name: org.apache.sling.commons.log.file
Type: String
Value: specify the Log File; for example, ../logs/assetcomposer.log
Name: org.apache.sling.commons.log.names
Type: String[] (String + Multi)
Value: specify the OSGi services for which the Logger is to log messages;
必要に応じて、その他のパラメーターを設定します Name: org.apache.sling.commons.log.pattern
Type: String
Value: specify the pattern of the log message as required
For example : {0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}] {3} {5}
ノード構造およびプロパティは以下と同様である必要があります。
CRX DE Lite で「すべて保存」をクリックすると、変更は直ちに有効になります。
|
|
|