This documentation is for WSO2 ESB version 4.0.3. View documentation for the latest release.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Current »

There are two ways of configuring Log4j as follows:

  • Editing through the management console - Changes are applied at runtime and persisted in WSO2 Registry and therefore are available even after you restart the server. You can also restore the original Log4j configuration from the log4j.properties file using the management console.
  • Editing the <PRODUCT_HOME>/repository/conf/log4j.properties file manually - You must restart the server to apply the changes. This overwrites the earlier log4j configuration that is persisted in the registry.

Follow the instructions below to set up logging.

1. Sign in. Enter your user name and password to log on to the ESB Management Console.

2. Click the "Configure" button to access the "Configure" menu.

3. From the "Configure" menu, select "Logging."

4. The "Logging Configuration" window appears.

WSO2 Carbon logging configuration

Tip

If you select "Persist All Configurations Changes" check box, all the modifications will be persisted and they will be available even after a server restart.

5. The "Logging Configuration" window has three sections:

  • Global Log4J Configuration
  • Configure Log4J Appenders
  • Configure Log4J Loggers

Using these sections, you can configure the layout and the amount of information about the system activity you want to receive.

Global Log4J Configuration

WSO2 Carbon Global Log4J Configuration

This section allows you to assign a single log level and log pattern to all loggers.

  • Log Level - Reflects a minimum level that this logger cares about. You can view the hierarchy of levels #below.
  • Log Pattern - Defines the output format of the log file.

Configure Log4J Appenders

WSO2 Carbon Configure Log4J Appenders

This section allows you to configure appenders. Log4j allows logging requests to print to multiple destinations. These output destinations are called "Appenders." You can attach several appenders to one logger.

  • Name-The name of an appender. By default, WSO2 ESB comes with the following log appenders configured:
    • CARBON_CONSOLE - Logs to the console when the server is running.
    • CARBON_LOGFILE - Writes the logs to ?ESB_HOME/repository/logs/wso2-esb.log.
    • SERVICE_APPENDER - Writes mediation time audit messages to ESB_HOME/repository/logs/wso2-esb-service.log.
    • TRACE_APPENDER - Writes mediation time tracing/debug messages to the ESB_HOME/repository/logs/wso2-esb-trace.log for tracing enabled services.
    • TRACE_MEMORYAPPENDER
    • CARBON_MEMORY
    • CARBON_SYS_LOG - Allows separation of the software that generates messages from the system that stores them and the software that reports and analyzes them.
  • Log pattern - Defines the output format of the log file.
  • Threshold - Filters log entries based on their level. For example, threshold set to "WARN" will allow log entry to pass into appender if its level is "WARN," "ERROR" or "FATAL," other entries will be discarded.
Hierarchy of Levels:
  • TRACE - Designates finer-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.

Configure Log4J Loggers

WSO2 Carbon Configure Log4J Loggers

This section allows you to browse through all loggers and define a log level and switch on/off additivity to any of them.

  • Logger - The name of a logger.
  • Parent Logger - The name of a parent logger.
  • Level - Allows to select level (threshold) from the drop-down menu. After you specify the level for a certain logger, a log request for that logger will only be enabled if its level is equal or higher to the logger’s one. If a given logger is not assigned a level, then it inherits one from its closest ancestor with an assigned level. See hierarchy of levels above.
  • Additivity - Allows to inherit all the appenders of the parent Logger if set as "True."

Tip

In this section, loggers can be filtered by the first characters (use the "Starts With" button) of by a combination of characters (use the "Contains" button).

  • No labels