Book Image

WSO2 Developer's Guide

By : Ramón Garrido, Fidel Prieto Estrada
Book Image

WSO2 Developer's Guide

By: Ramón Garrido, Fidel Prieto Estrada

Overview of this book

WSO2 Enterprise Integrator brings together the most powerful servers provided by the WSO2 company for your SOA infrastructure. As an Enterprise Service Bus (ESB), WSO2 Enterprise Integrator provides greater flexibility and agility to meet growing enterprise demands, whereas, as a Data Services Server (DSS), it provides an easy-to-use platform for integrating data stores, creating composite views across different data sources, and hosting data services. Using real-world scenarios, this book helps you build a solid foundation in developing enterprise applications with powerful data integration capabilities using the WSO2 servers. The book gets you started by brushing up your knowledge about SOA architecture and how it can be implemented through WSO2. It will help build your expertise with the core concepts of ESB such as building proxies, sequences, endpoints, and how to work with these in WSO2. Going further, you will also get well-acquainted with DSS data service concepts such as configuring data services, tasks, events, testing, and much more. The book will also cover API management techniques. Along with ESB and DSS, you will also learn about business process servers, the rules server and other components that together provide the control and robustness your enterprise applications will need. With practical use cases, the book covers typical daily scenarios you will come across while using these servers to give you hands-on experience.
Table of Contents (14 chapters)

Logging per API and per proxy service

Another way of logging information in a Rest API or a proxy is enabling the logging per API or proxy functionality, which will create a log file per API or proxy where all information logged is written.

To enable logging per API, we just need to configure the API_LOGGER category of the log4j.properties. We will assume that our rest API is called myFirstRestAPI. Then, we just follow these steps:

  1. Open $EI_HOME/conf/log4j.properties.
  2. Add the following section for the INFO level in the API_LOGGER category:
log4j.category.API_LOGGER=INFO, API_APPENDER 
log4j.additivity.API_LOGGER=false 
log4j.appender.API_APPENDER=org.apache.log4j.RollingFileAppender 
log4j.appender.API_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-ei-api${instance.log}.log 
log4j.appender.API_APPENDER.MaxFileSize=1000KB 
log4j.appender.API_APPENDER.MaxBackupIndex...