# Log Mediator

With the log mediator, you can log messages being mediated.

Figure1: Log Mediator

## Log Category

You can select the log category to be one of following values. Following log levels correspond to ESB service level logs.

- TRACE - Designates fine-grained informational events than the DEBUG.
- DEBUG - Designates fine-grained informational events that are most useful to debug an application.
- INFO - Designates informational messages that highlight the progress of the application at coarse-grained level.
- WARN - Designates potentially harmful situations.
- ERROR - Designates error events that might still allow the application to continue running.
- FATAL - Designates very severe error events that will presumably lead the application to abort.

You can add or edit the /repository/conf/log4j.properties file to select the category you want to log per service. The default log category is INFO

## Log Level

You can select the log level to be one of following values.

- Simple: To, From, WSAction, SOAPAction, ReplyTo, MessageID and any properties
- Headers: All SOAP header blocks and any properties
- Full: All attributes included in log level 'simple' and the SOAP envelope and any properties
- Custom: Only properties specified to the Log mediator

## Log Separator

The log separator is used to separate the attributes being logged. The default separator is ',' (comma).

## Adding Properties

You can add custom messages to log as the messages mediate thorough the log mediator.

Figure2: Log Mediator Properties

- Property Name: Name for the property
- Property Value: The type of the property value, possible candidates are Value/Expression
  - Value - A static text message
  - Expression - An xpath expression executed on each mediating message
- Value: The text or an expression you want to log
- NSEditor: You can click this link to add namespaces if you are providing an expression. You will be provided another panel named 'Namespace Editor' where you can provide any number of namespace prefixes and url that you have used in the xpath expression. Here is an example of the use of namespaces in an expression.

  Figure2: Log Mediator Properties - Providing Expression with Namespaces

- Action: Delete the property