Umair Khalid
Umair Khalid

Reputation: 579

How to get Process ID in WSO2 ESB 4.8.1

I am using WSO2 ESB 4.8.1. and want to get the process id . Is it possible to access it in the ESB? I have to log it for some logging purposes.

Upvotes: 1

Views: 544

Answers (2)

Hasitha Aravinda
Hasitha Aravinda

Reputation: 481

As I know, there is no process ID concept in WSO2 ESB. I guess process ID concept comes with long running processes.

But if you need to get a unique ID per request, you can use the message ID. Refer link [1]. Use log mediator [2] with message ID property.

Please note that, Logging every request's message ID may affect the performance in high concurrent systems.

[1] - https://docs.wso2.com/display/ESB481/SOAP+Headers#SOAPHeaders-MessageID [2] - https://docs.wso2.com/display/ESB481/Log+Mediator

Upvotes: 1

Ratha
Ratha

Reputation: 9702

I think, you want to have separate logs for separate services in wso2esb. You should be able to achieve that via by editing log4j properties file.

eg:
 log4j.category.SERVICE_LOGGER.SimpleStockQuoteProxy=INFO, PROXY_APPENDER
log4j.additivity.PROXY_APPENDER=false
log4j.appender.PROXY_APPENDER=org.apache.log4j.DailyRollingFileAppender
log4j.appender.PROXY_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-esb-stockquote-proxy${instance.log}.log
log4j.appender.PROXY_APPENDER.Append=true
log4j.appender.PROXY_APPENDER.layout=org.apache.log4j.PatternLayout
log4j.appender.PROXY_APPENDER.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%

Here is a post which i have written, you may check.

Upvotes: 0

Related Questions