• No replies
1 Post

Pinned topic How to log messages to multiple log files?

‏2014-02-07T12:16:25Z | java.util.logging jul websphere-liberty

I want to log messages from different applications of Liberty Profile Server to different log files. For example, suppose there are two application like App_1 and App_2, then what I want is log message from App_1 should go to app1_message.log and messages from App_2 should go to app2_messages.log.

I have tried to achieve this by specifying multiple <logging> tags in server.xml as below but it did not work:-

<logging consoleLogLevel="INFO" traceFormat="ADVANCED" traceSpecification="*=all" />

<logging traceSpecification="*=audit:com.myco.mypackage.*=debug" messageFileName="app1_messages.log"/>


Another way to achieve this is through code by creating FileHandler object as suggested by this link:


But we want to do this purely through configuration file, i.e. through file. That is the challenge.


I love Log4J but sadly that is not an option. We are stuck with java.util.logging. Any suggestions/pointers will be helpful.