For debugging I would like to get DEBUG level log messages of a certain log category in the log files of Xpert.ivy Server.

How can I configure this?

asked 06.06.2014 at 13:51

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.6k172450
accept rate: 74%

edited 12.06.2014 at 09:53


The log configuration can be changed in the file configuration/log4jconfig.xml.

To configure the log level of a certain category add the following xml to the log4jconfig.xml:

<category name="ch.ivyteam.ivy.security" class="ch.ivyteam.log.Logger">
  <priority value="DEBUG"/>
</category>

Change ch.ivyteam.ivy.security with he name of the category you want to configure.

The log category now logs messages with DEBUG level. But they will not yet be written to the log file because the FileLog appender has normally a threshold set to INFO level. All message with a log level below the threshold are not written to the log file. Therefore you have to change the threshold in the FileLog appender configuration from INFO to DEBUG in the log4jcongig.xml file as follows:

<appender name="FileLog" class="org.apache.log4j.DailyRollingFileAppender">
  <param name="Threshold" value="DEBUG"/>
  <param name="File" value="${user.dir}/logs/ch.ivyteam.ivy.log"/>
  <param name="DatePattern" value="'.'yyyy-MM-dd"/>
  <layout class="org.apache.log4j.IvyLog4jLayout">
    <param name="DateFormat" value="HH:mm:ss.SSS"/>
  </layout>
</appender>
link

answered 06.06.2014 at 14:04

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.6k172450
accept rate: 74%

I would just point out that elements such as category and priority are considered deprecated and must be replaced by logger and level respectively.

As indicated by org.apache.log4j.Category:

This class has been deprecated and replaced by the Logger subclass. It will be kept around to preserve backward compatibility until mid 2003.

Notice that in the ServerGuide.pdf document, deprecated terminology is used and must be updated.

link

answered 28.11.2014 at 16:33

Adriano%20Labate's gravatar image

Adriano Labate
12181118
accept rate: 33%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×19

Asked: 06.06.2014 at 13:51

Seen: 3,060 times

Last updated: 28.11.2014 at 16:33