Logging Management - User Guide
Logging Management
Configure Logging
This page shows the existing Log4j configuration. And it also allows you to modify existing configuration. You can
either modify the global Log4j configuration, an Appender or a Logger. If you select
Persist all Configurations Changes check box, all the modifications will be
persited and they will be available even after a server restart.
Configuring Log4J Loggers
Configuring properties related to Log4J loggers.
In the View
list, select the category of logs you want to view. The available
categories are,
Select a Log Level (only the messages
at that level and below
will be logged).
For example, if you select Log Level ERROR, then all
ERROR
and FATAL messages will be logged or rather passed on to the Appender.
Switching on Additivity allows to inherit all the
Appenders of the
parent Logger.
Figure 1: Monitor Logs
Configure Syslog Properties
Configuring properties related to syslog-ng.
To configure the syslog properties first add syslog log4j appender under configure as shown in the figure 2.
Figure 2: Configure Log4J Syslog Appenders
By using the Syslog configuration feature, you can set
a remote log host and retrieve logs from that location
Syslog-ng log host - location that log files are hosted
Port
Realm
User Name
Password
Modify the values for the above settings as
required
and click Update.
Figure 3: Syslog-ng
Configuration
Configuring Log4J Appenders
Log4J Appenders consist of the appender name, log
level, known as the
Threshold, log pattern and log file.
The Threshold list is the same as the Log Level in Loggers,
in
name and
function. You can use Log Pattern to edit the format or the
layout in which
the logs are created. You can refer to the log4j
PatternLayout page for descriptions of the values
that are used in the log
pattern. Finally you can change the location of the log file with the
Log
File option.
Select the Name of the appender you wish to modify.
Specify the desired log pattern.
Select the logging threshold.
Click Update.
Figure 4: Configure Log4J
Appenders
Configuring
Global
Log4J Loggers
By using the Global Log4J configuration feature, you can set
the,
Log Level
Log Pattern of Log4J Appenders
Loggers to the same value at the same time.
Modify the values for the above settings as
required
and click Update.
Figure 5: Global Log4J
Configuration
There are two ways of configuring Log4j in WSO2 Carbon. Either by manually editing the log4j.properties file
or through the management console. Changes you made to Log4j configuration through the management console are persisted in
WSO2 Registry, therefore those changes will be available after server restarts. There is also an option to restore the
original Log4j configuration from the log4j.properties file using the management console. But if you modify the
log4j.properties file and restart the server, you will see the changes you've made. That means the earlier log4j
configuration persisted in the registry is overwritten.