...
Logging is one of the most important aspects of a production-grade server. A properly configured logging system is vital for identifying errors, security threats and usage patterns. All All WSO2 products use a log4j-based logging mechanism through Apache Commons Logging facade libraryare shipped with the log4j logging capabilities, which generates all the administrative activities and server side logs. The log4j.properties
file, which governs how logging is performed by the server can be found in the <PRODUCT_HOME>/repository/conf
directory.
Note that in addition to the logs from libraries that use Log4j, all logs from libraries (such as, Tomcat, Hazelcast and more) that use Java logging framework are also visible in the same log files. ThereforeThat is, when Java logging is enabled in Carbon, only the Log4j appenders will write to the log files. If the Java Logging Handlers have logs, these logs will be delegated to the log events of the corresponding Log4j appenders. A Pub/Sub registry pattern implementation has been used in the latter mentioned scenario to plug the handlers and appenders. The following default log4j appenders are in the log4j.properties
file are used for this implementation:
org.wso2.carbon.logging.appenders.CarbonConsoleAppender
org.wso2.carbon.logging.appenders.CarbonDailyRollingFileAppender
For more information on appenders, loggers, their log levels and logging, see http://logging.apache.org/log4j.
Logging functionality is provided by the following feature in the WSO2 feature repository:
...
Configuring products for logging
The log4j.properties
file, which governs how logging is performed by the server, can be found in the <PRODUCT_HOME>/repository/conf
directory. Given below are ways to configure log4j files:
...
The latter is recommended because all changes made to log4j through the management console persist in the WSO2 Registry. Therefore, those changes will be available after the server restarts. Changes that you make to the logging configuration via the management console will get priority over what is defined in the actual log4j.properties
file. However, if you modify the log4j.properties
file and restart the server, the earlier log4j configuration that persisted in the registry will be overwritten. There is also an option in the management console to restore the original log4j configuration from the log4j.properties
file.
Remedies for log growth
Excerpt | ||
---|---|---|
| ||
WRITERS: The following information is from the following FAQ: http://docs.wso2.org/display/FAQ/Logging#Logging-Whataretheremediesforloggrowth If you make changes to the content here, be sure to update it there as well. |
Log growth can be managed by the following configurations in the <PRODUCT_HOME>/repository/conf/
log4j.properties
file.
...